Comments (23)
I hit this error running the very first how-to-npm verify
command.
I decided to uninstall nodejs from the default location C:\Program Files\nodejs
Then install it to this location instead C:\nodejs
Doing this got me a little further but the command still failed...
I looked at the proposed fix here...
https://github.com/npm/how-to-npm/pull/17/files
And manually made the following change to see if it would get me any further...
Making the change above got me past the first how-to-npm verify
command...
Pardon the detailed response but us windows users need the most help. People running into this error need how-to-npm
the most! 😆
from how-to-npm.
If you have the error you may try run 'how-to-npm' in 'Node.js command prompt'.
from how-to-npm.
@jgbbarreiros it only works if you run Node.js command prompt as Administrator user. If you do not you still get the error below
from how-to-npm.
Yes, this is very likely related to the Windows path. Thanks for posting the issue, we'll have to look into it.
from how-to-npm.
I have the same problem with chapter 5 as @ghsamm has, but in addition I have failed validation of the first chapter ( I am also Windows 7 user):
verifying that npm is installed...
Uh oh! npm had a problem! {"killed":false,"code":1,"signal":null}
'c:\Program' is not recognized as an internal or external command,
operable program or batch file.
#########################################
YOUR SOLUTION IS NOT CORRECT!
#########################################
from how-to-npm.
Error is reproducible : same as ghsamm 's
from how-to-npm.
This seems to be related to https://www.npmjs.com/package/which that returns escaped path to node.exe
, but doesn't escape blanks. That is, it would be C:\\Program Files\\nodejs\\node.exe
instead of C:\\Program\ Files\\nodejs\\node.exe
.
As a temp fix one could edit problems' js files that have that "problem" and remove references to which
and just assign 'npm'
to npm variable where which.sync(...)
was used.
There's where
command on windows similar to which
on linux so maybe it'd make sense to get rid of which
package altogether and use those instead.
EDIT:
I looked a bit more into it and it doesn't seem which
package problem. Somehow the verify
causes windows cmd.exe
with /s
flag which causes the subsequent command interpretation to fail.
from how-to-npm.
thank you @gitting this is working just replace var
npm = require('which').sync('npm')
with
var npm = "npm"
from how-to-npm.
Should we convert this into a pull request as +5 folks had it tonight nodeschool dublin?
from how-to-npm.
Just wanted to add my +1 to this. Got this error on Windows 8. @ghsamm 's solution worked, but not doing a PR yet -- first I'm just curious why require('which').sync('npm')
was there in the first place? Is there any harm in just using 'npm'?
from how-to-npm.
@rustybailey - good question, and I have wondered as well. At least in Windows, if where
finds npm
then npm
can be used by itself and be found just the same. I would assume that Linux's which
works the same way.
from how-to-npm.
+1 on Windows 8.1. Happening on all steps after '05 Login'.
Glad to see it has already been noted nonetheless!
from how-to-npm.
verifying that npm is installed...
Uh oh! npm had a problem! {"killed":false,"code":1,"signal":null,"cmd":"C:\Win
dows\system32\cmd.exe /s /c "D:\Program Files\nodejs\npm.CMD --version""}
'D:\Program' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
#########################################
YOUR SOLUTION IS NOT CORRECT!
#########################################
same thing happens to me
from how-to-npm.
Hey @isaacs @mmalecki @linclark with nodeschool Intl only a couple of weeks away any chance we can have #17 reviewed and pushed by someone from the
"wombat distribution unit" ? :)
Thanks
from how-to-npm.
+1 same issue here. Running how-to-npm
verify on Windows 10 Build 10130 inside of PowerShell 5.0. I'm a bit surprised that the issue hasn't been resolved after months of reported issues.
Code needs to properly plan for spaces in filesystem paths. :)
Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell
from how-to-npm.
I think this was made to run on the Node.js command prompt. There it works fine for me.
from how-to-npm.
from how-to-npm.
Getting the same error.
from how-to-npm.
i was also getting same error then tried this using nodejs cmd it worked
from how-to-npm.
@run-time Thank you for the solution I had the same problem (windows 10, npm 3.10.5) at the exercises 00, 02,07 and your solution worked for all of them. Thanks a lot!!
from how-to-npm.
@ghsamm Thank you for the solution.
from how-to-npm.
#108 is shipeed as v2.4.1. Closing as resolved :)
from how-to-npm.
Still a bug? https://stackoverflow.com/questions/72518859/npx-isnt-working-on-powershell-or-cmd-even-using-the-right-file-types
from how-to-npm.
Related Issues (20)
- Update the label names HOT 1
- Pull request #108 rolls back fix #57 HOT 5
- Incorrectly reports wrong folder on windows due to case sensitivity HOT 1
- Version checking issue with "00 Install npm" exercise HOT 3
- how-to-npm HOT 2
- Very basic NPM newbie question HOT 2
- Cannot publish HOT 2
- npm publish needs a paid account HOT 3
- Renew the problems to support npm@5
- Error, when trying to reset registry HOT 3
- when I type how-to-npm in terminal It gives me the following error HOT 2
- Challenge 00: doesn't tell you how to check version HOT 1
- npm-init fails in Dev Enviroment
- No outdated packages ... HOT 1
- "npm install <package-name>" better than "npm install <module-name>"
- should keep bundleDependencies in package.json? HOT 1
- no such file or directory, chmod '/usr/local/lib/node_modules/how-to-npm/node_modules/mkdirp/bin/cmd.js' HOT 7
- Error: Cannot find module 'workshopper-adventure/adventure' HOT 2
- npm adduser -> Error: code ENYI Web login not supported
- Is this repository still being maintained in 2023? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from how-to-npm.