It's more likely a windows bug, but npm should overcome it somehow.
How to reproduce:
Error: Cannot find module 'C:\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Tested on Windows 2008r2 server and Windows 7.
Vim plugins usually invoke all the commands in quotes, so this issue is very annoying.
I tried to explore this issue and discovered that %~dp0 returns cwd if %0 starts with " symbol. I have no idea how fix it.
I think I have found a partial solution. If I prepend the following code to the generated .cmd file everything works.
@IF NOT EXIST "%~dp0\node_modules\jslint\bin\jslint.js" (
@if "%~0" EQU %0 (call %~0 %*)
This solution doesn't work if the filename contains spaces or if %0 contains wuotes in the middle. Though it should work for the most of npm packages.
Should I submit it as a pull request?
I just tried to re-verify this with email@example.com on Windows 7 and it appears to have been fixed .. sometime in the last two years.
If you have the opportunity to test this with the current version of npm, can you check to see if vim plugins now work?
We are trying to clean up older npm issues, so if we don't hear back from you within a week, we will close this issue. (Don't worry -- you can always come back again and open a new issue!)
Yes, now vim plugins finally work. Though upgrading npm on windows is not an easy task, but that's another issue.
Yes, upgrading npm on Windows is a pain. I generally recommend people use option 3 from here: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows -- I hope you found that or something like it.