Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx not working after install in 1.1.6 #293

Closed
9 of 10 tasks
gingters opened this issue Aug 3, 2017 · 13 comments
Closed
9 of 10 tasks

npx not working after install in 1.1.6 #293

gingters opened this issue Aug 3, 2017 · 13 comments

Comments

@gingters
Copy link

gingters commented Aug 3, 2017

My Environment

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

I'm using NVM4W version:

  • 1.1.6

I have already...

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn't already been resolved.
  • verified I'm using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn't a duplicate.
  • 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):

  • A standard shell environment (terminal/powershell)
  • 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.

@coreybutler
Copy link
Owner

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.

@codepunkt
Copy link

codepunkt commented Sep 15, 2017

@coreybutler any news? same problem here, can't update to anything newer than node 8.1.4 because npm breaks.

@borekb
Copy link

borekb commented Nov 7, 2017

As a workaround, npm i -g npx makes npx available.

@SteveALee
Copy link

SteveALee commented Dec 2, 2017

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

@coreybutler
Copy link
Owner

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.

@SteveALee
Copy link

Thanks. I've been using @borekb's work-around without problems

@psimoneau22
Copy link

psimoneau22 commented Dec 19, 2017

not working for me, will use the workaround for now, but also following

@gijswijs
Copy link

Same here. Used workaround.
sub

@oleh-shalyhin
Copy link

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}/

@fmaiabatista
Copy link

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.

@aosi87
Copy link

aosi87 commented Jul 18, 2018

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.

@epikhighs
Copy link

this issue was resolved for me with using nvm 1.1.7 (#288 (comment))

@coreybutler
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests