After installing a node version 8.2 or higher (in this case 8.2.1) that ships with npx, npx should work.
In C:\Users\%UserName%\AppData\Roaming\nvm\v8.2.1
there is no command file for npx.
In C:\Users\%UserName%\AppData\Roaming\nvm\v8.2.1\node_modules\npm\bin
npx is available though.
Install nvm4w 1.1.6 prerelease, which should have npx support according to #288
Call nvm install 8.2.1
Call nvm use 8.2.1
and acknowledge the UAC windows
Call npx --version
npx cannot be called.
Are you compiling from source? The code base for 1.1.6 has support, but I have not yet cut a release that has the npx support.
If you're compiling from source and seeing this issue, then there's definitely a bug. Otherwise, it just isn't there yet. I'm hopeful I'll find some time tonight to cut the new release.
@coreybutler any news? same problem here, can't update to anything newer than node 8.1.4 because npm breaks.
As a workaround, npm i -g npx
makes npx
available.
Npx is still not there anywhere on the path after an install of nvm and using latest LTS node
I'm on Windows 10 btw
No news - other than the fact the npm issues are upstream. @borekb suggested the only viable option at the moment. There's another issue open re: npm and the issues, so I suggest following along there.
Thanks. I've been using @borekb's work-around without problems
not working for me, will use the workaround for now, but also following
Same here. Used workaround.
sub
One more workaround without installing npx globally:
1) Go to {nvm_directory}/{your_version}/node_modules/npm/bin
2) Copy both files: npx
and npx.cmd
3) Paste them into {nvm_directory}/{your_version}/
Using @oleh-shalyhin's workaround gives me:
npx: 1 installed in X.XXs
Path must be a string. Received undefined
9.7.1
everytime I run npx...
It works though.
Everything works perfectly for me, I just installed windows and installed nvm, the only problem was the missing NPX command from the PATH, I did use the npm install -g npx
'cause I think is the easiest way to manage updates and packages, will be a cleaner way to go back to the default npm installation if I require to update nvm.
My recommendation here is: if it is a bug please add the workaround in the README.md so everyone can be aware of this.
Cheers.
this issue was resolved for me with using nvm 1.1.7 (https://github.com/coreybutler/nvm-windows/issues/288#issuecomment-424451848)
The original issue still stands (for older versions of npm/npx) because, well, they're just broken (an npm thing). If you can't get a newer version of npx, upgrade to at least NVM4W 1.1.7. npm also changed their github repo, which was a hard coded link into NVM4W. v1.1.7 supports both the new and old link.
Most helpful comment
One more workaround without installing npx globally:
1) Go to
{nvm_directory}/{your_version}/node_modules/npm/bin
2) Copy both files:
npx
andnpx.cmd
3) Paste them into
{nvm_directory}/{your_version}/