Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

npx fails on Windows 7 #62

Closed
simonua opened this issue Jul 11, 2017 · 25 comments
Closed

npx fails on Windows 7 #62

simonua opened this issue Jul 11, 2017 · 25 comments
Labels

Comments

@simonua
Copy link
Contributor

simonua commented Jul 11, 2017

Hi Kat,

Thanks for releasing npx! Sorry to file a bug so quickly. =(

Windows 7 64-bit
node: 8.1.3
npm: 5.2.0
npx: 9.0.3

This probably relates to #58 but is on a different setup with a seemingly different error.

I see the same issue with two different command shells, so to keep this on a common denominator across, just use cmd.exe to run this in:

image

image

Unrelated perhaps, but this gets interesting, too, when cowsay, etc. is already installed globally.

image

@zkat zkat added the bug label Jul 11, 2017
@katemihalikova
Copy link
Collaborator

The first screen shows the js file being run. This is probably the same problem I had today (npm-cli.js was being opened in my editor by which). This should be solved with changes in calling the js file so it's the same as #58.

The second screen is almost the same as #58 so I suppose there is a common denominator in which again.

The last screen is the same problem as #60.

@simonua
Copy link
Contributor Author

simonua commented Jul 12, 2017

@katemihalikova, thank you. I think you're spot on. I missed #60 when I looked through the few issues. Since this is fairly covered then, I suspect it could just be closed as a duplicate, @zkat, but will defer to you to make that call for sure. Sorry for the noise. =(

@katemihalikova
Copy link
Collaborator

No need to be sorry, your report also added one very important piece of that windows puzzle. Thanks! 🎉

@zkat zkat closed this as completed in 6cfb8de Jul 12, 2017
@Mithgol
Copy link

Mithgol commented Jul 12, 2017

Unfortunately, npx v9.1.0 still fails on my Windows 7 with the message Command failed: c:\Utils\Node\node_modules\npx\node_modules\npm\bin\npm-cli.js config get cache --parseable (where c:\Utils\Node\ is the path to Node.js) after a bit of trying to run Windows Scripting Host.

@katemihalikova
Copy link
Collaborator

So it still tries to run the file in its associated program instead of node.. I'll try to look into it more then. Thanks for reporting!

@zkat
Copy link
Owner

zkat commented Jul 12, 2017

I think I understand why this one's happening

@zkat zkat closed this as completed in 0fffca2 Jul 14, 2017
@zkat
Copy link
Owner

zkat commented Jul 14, 2017

This is fixed, and will be included in the next release.

Source: I'm literally on Windows right now. 😂

@simonua
Copy link
Contributor Author

simonua commented Jul 14, 2017

@zkat, lol, welcome! This must be a bit of an out-of-body experience for a loyal Mac user? =P

@simonua
Copy link
Contributor Author

simonua commented Jul 14, 2017

And thanks for the fix. =P

@zkat
Copy link
Owner

zkat commented Jul 14, 2017

I'm not really loyal, I'm just too lazy to reboot and I don't trust VMs to be good enough to do real cross-platform work.

Ironically, the npx build and release scripts don't run on Windows, so I'll have to run a new release after I'm done doing Windows stuff today. ;)

@simonua
Copy link
Contributor Author

simonua commented Jul 14, 2017

I hear you on the reboot. =(

@zkat
Copy link
Owner

zkat commented Jul 14, 2017

lol I have a few more fixes to do with Windows, it seems. Probably better that I'm taking my time with this anyway, I guess.

zkat added a commit that referenced this issue Jul 14, 2017
@zkat
Copy link
Owner

zkat commented Jul 15, 2017

ok. npx@9.2.1 should have fixed this problem. Please file another issue if you find more Windows stuff. I want that platform to work super well for folks <3

@Mithgol
Copy link

Mithgol commented Jul 15, 2017

Yeah, seems to be fixed in v9.2.1, congratulations. 🎉

@simonua
Copy link
Contributor Author

simonua commented Jul 15, 2017

Different, but not quite there for me:

image

@zkat
Copy link
Owner

zkat commented Jul 15, 2017

Oh bollocks.

I even told myself I needed to remember to bring the path escaping along. I totally forgot. Sorry again lol

@simonua
Copy link
Contributor Author

simonua commented Jul 15, 2017

No worries. Happy to check it out with the next fix.

@zkat
Copy link
Owner

zkat commented Jul 15, 2017

@simonua can you give 9.2.2 a whirl?

@simonua
Copy link
Contributor Author

simonua commented Jul 15, 2017

You bet but I'm afk right now. Got plans for rest of day but can look early tomorrow my time. I'm sorry. 🙁

@simonua
Copy link
Contributor Author

simonua commented Jul 15, 2017

@zkat, just checked with 9.2.2

image

@zkat
Copy link
Owner

zkat commented Jul 15, 2017

I'm gonna go mope for a while now. I'll try again on Monday I guess. lol.

@zkat
Copy link
Owner

zkat commented Jul 15, 2017

@simonua I've filed #84 to track this separately. I'll spend some more time combing through Windows issues. I think I didn't run into this because my npm is installed into C:\Users\kat\..., so there's no spaces 🙃

@simonua
Copy link
Contributor Author

simonua commented Jul 18, 2017

Confirmed all cases to be working. It's nice that it appears to prefer a globally-installed module rather than attempting to pull from the registry or extract from cache.

Mithgol added a commit to Mithgol/npmtree that referenced this issue Jul 20, 2017
@Mithgol
Copy link

Mithgol commented Oct 13, 2017

This issue has resurfaced in npx version 9.6.0.

Once again this version (bundled with npm v5.5.1) tries Windows Script Host (i.e. runs a script in JavaScript's default system handler) instead of using Node.js path that npx should have in its process.argv[0].

Screenshot (after using npx npmtree fidohtml to test):

(screenshot)

It does not say Command failed: . . . in the console afterwards, it just says null.

@Mithgol
Copy link

Mithgol commented Oct 13, 2017

However, it only happens in npmtree's own directory (cloned from GitHub) and does not happen in any other directory. Could be a separate issue. Should I open a separate issue?

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

No branches or pull requests

4 participants