Nvm-windows: npx not working after install in 1.1.6

Created on 3 Aug 2017  路  13Comments  路  Source: coreybutler/nvm-windows

My Environment

  • [X] Windows 10 IoT Core
  • [ ] My Windows installation is non-English.

I'm using NVM4W version:

  • [X] 1.1.6

I have already...

  • [X] read the README to be aware of npm gotchas & antivirus issues.
  • [X] reviewed the wiki to make sure my issue hasn't already been resolved.
  • [X] verified I'm using an account with administrative privileges.
  • [X] searched the issues (open and closed) to make sure this isn't a duplicate.
  • [X] made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • [X] A standard shell environment (terminal/powershell)
  • [X] A non-standard shell environment (Cmder, Hyper, Cygwin, git)
    not working in normal cmd terminal as well as in Cmder.

Expected Behavior

After installing a node version 8.2 or higher (in this case 8.2.1) that ships with npx, npx should work.

Actual Behavior

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.

Steps to reproduce the problem:

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.

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 and npx.cmd
3) Paste them into {nvm_directory}/{your_version}/

All 13 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

petrovicz picture petrovicz  路  4Comments

thany picture thany  路  4Comments

Deilan picture Deilan  路  4Comments

tomByrer picture tomByrer  路  4Comments

AllainPL picture AllainPL  路  7Comments