-
-
Notifications
You must be signed in to change notification settings - Fork 105
npx fails to find npm on Windows 10 #58
Comments
huh! I don't understaaaaaand. I think in this case, this is an npm bug, but I'm fine tracking it here. Basically, something's really weird with what https://github.com/npm/npm/blob/latest/bin/npx-cli.js#L6 is doing when executed through https://github.com/npm/npm/blob/latest/bin/npx.cmd, and I think I'm just misunderstanding how Does this work at all if you do |
I'm curious whether you or @seriousManual can still repro this when using |
hi @zkat i am using cmd.exe, not powershell |
Same problem here, using cmder (which uses ConEmu). npx https://gist.github.com/zkat/4bc19503fe9e9309e2bfaa2c58074d32
not found: C:\Users\Olivier\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js When I try to open "C:\Users\Olivier\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" it works fine (the file exists) Per your suggestion I tried: npm i -g npx@latest
C:\Users\Olivier\AppData\Roaming\npm\npx -> C:\Users\Olivier\AppData\Roaming\npm\node_modules\npx\index.js
+ [email protected]
added 507 packages in 12.131s It still fails but with another error (same error as bug #61): npx https://gist.github.com/zkat/4bc19503fe9e9309e2bfaa2c58074d32
npx: installed 1 in 4.432s
npx: command not found: 4bc19503fe9e9309e2bfaa2c58074d32
C:\Users\Olivier\AppData\Roaming\npm\node_modules\npx\node_modules\libnpx\index.js:139
process.on('exit', () => rimraf.sync(prefix))
^
TypeError: rimraf.sync is not a function
at process.on (C:\Users\Olivier\AppData\Roaming\npm\node_modules\npx\node_modules\libnpx\index.js:139:37)
at emitOne (events.js:96:13)
at process.emit (events.js:188:7) |
The problems seems to be with the
In Linux it calls Under Windows, it calls
The path is valid:
|
A sequel to my debugging in #60. Error The root of the problem is that const args = buildArgs(specs, prefix, opts)
- return which(opts.npm).then(npmPath => {
- return child.spawn(npmPath, args, {
+ return which('node').then(nodePath => {
+ args.unshift(opts.npm);
+ return child.spawn(nodePath, args, {
stdio: [0, 'pipe', opts.q ? 'ignore' : 2]
This solution moves me forward to the error in #61 😄 This problem is not present in |
The text was updated successfully, but these errors were encountered: