Giter Site home page Giter Site logo

Comments (23)

run-time avatar run-time commented on August 22, 2024 9

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...
image

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...
image

Making the change above got me past the first how-to-npm verify command...
image

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.

8fdafs2 avatar 8fdafs2 commented on August 22, 2024 2

If you have the error you may try run 'how-to-npm' in 'Node.js command prompt'.

from how-to-npm.

IanLawrence avatar IanLawrence commented on August 22, 2024 1

@jgbbarreiros it only works if you run Node.js command prompt as Administrator user. If you do not you still get the error below
screenshot 67

from how-to-npm.

linclark avatar linclark commented on August 22, 2024

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.

sejoker avatar sejoker commented on August 22, 2024

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.

jsjaimohan avatar jsjaimohan commented on August 22, 2024

Error is reproducible : same as ghsamm 's

from how-to-npm.

gitting avatar gitting commented on August 22, 2024

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.

ghsamm avatar ghsamm commented on August 22, 2024

thank you @gitting this is working just replace var
npm = require('which').sync('npm')
with
var npm = "npm"

from how-to-npm.

No9 avatar No9 commented on August 22, 2024

Should we convert this into a pull request as +5 folks had it tonight nodeschool dublin?

from how-to-npm.

rustybailey avatar rustybailey commented on August 22, 2024

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.

gitting avatar gitting commented on August 22, 2024

@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.

 avatar commented on August 22, 2024

+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.

CKcaesar avatar CKcaesar commented on August 22, 2024

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.

No9 avatar No9 commented on August 22, 2024

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.

pcgeek86 avatar pcgeek86 commented on August 22, 2024

+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. :)

2015-06-29 21_24_11-windows shell experience host

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

from how-to-npm.

jgbbarreiros avatar jgbbarreiros commented on August 22, 2024

I think this was made to run on the Node.js command prompt. There it works fine for me.

from how-to-npm.

ashleygwilliams avatar ashleygwilliams commented on August 22, 2024

related: #19 #32 #33 #17

from how-to-npm.

divo93 avatar divo93 commented on August 22, 2024

Getting the same error.

from how-to-npm.

cannelflow avatar cannelflow commented on August 22, 2024

i was also getting same error then tried this using nodejs cmd it worked

from how-to-npm.

nickpapasavvas avatar nickpapasavvas commented on August 22, 2024

@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.

sahil-lakhwani avatar sahil-lakhwani commented on August 22, 2024

@ghsamm Thank you for the solution.

from how-to-npm.

watilde avatar watilde commented on August 22, 2024

#108 is shipeed as v2.4.1. Closing as resolved :)

from how-to-npm.

jszabo98 avatar jszabo98 commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.