help icon indicating copy to clipboard operation
help copied to clipboard

npm init hangs at "Is this OK (yes)"

Open dzwick opened this issue 9 years ago • 10 comments

Node.js Version - v6.11.5 npm Versio -v3.10.10 OS Windows 10 Pro Version 1703

I just installed Node and npm, and I'm trying to run npm init. I get up to:

About to write to C:\Users\dylan\package.json:

{ "name": "dylan", "version": "1.0.0", "description": "This is a test", "main": "index.js", "directories": { "test": "test" }, "scripts": { "test": "Sup Boys" }, "repository": { "type": "git", "url": "Nowhere" }, "keywords": [ "Gazinga" ], "author": "Dylan", "license": "ISC" }

Is this ok? (yes)


However, when I hit return or type "yes" it doesn't exit, and just hangs. Not sure what's going on here. If I hit Ctrl-C it exits and there is a package.json file created.

dzwick avatar Oct 27 '17 20:10 dzwick

Hi @dzwick! One thing you can definitely try is the latest version of Node (8.8.1) from https://nodejs.org/en/ instead of 6.11.5. It would probably be good to know if that problem also occurs with Node 8?

(Also, you should also be able to upgrade npm through running npm install -g npm – that may or may not help too!)

addaleax avatar Oct 27 '17 20:10 addaleax

If you are in windows, you probably won't be able to update npm running npm install -g npm. Check out npm-windows-upgrade.

Just for curiosity, why you want to create a project in your user/profile folder?

michaeljota avatar Oct 30 '17 21:10 michaeljota

OK! I updated the version and it's working fine now. Thank you!

dzwick avatar Oct 31 '17 23:10 dzwick

same issue for me. didn't find any solution.

hemantsan avatar Apr 26 '18 08:04 hemantsan

@dzwick is this a versioning issue ?

hemantsan avatar Apr 26 '18 08:04 hemantsan

not working even after updating npm

hemantsan avatar Apr 26 '18 09:04 hemantsan

@vieckys Can you give more information? What OS are you using? Run node -v, run npm -v. Another thing you may find helpful so we can help you.

michaeljota avatar Apr 26 '18 16:04 michaeljota

hey @michaeljota . i got it fix. It was the versioning issue. i had to restart my system. Thanks BTW

hemantsan avatar Apr 27 '18 05:04 hemantsan

issue resolved, closing then.

gireeshpunathil avatar Apr 27 '18 06:04 gireeshpunathil

sorry, didnt realize that it was already closed, and re-opened instead. Closing now.

gireeshpunathil avatar Apr 27 '18 06:04 gireeshpunathil