20

npm hangs on any command

 2 years ago
source link: https://www.codesd.com/item/npm-hangs-on-any-command.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

npm hangs on any command

advertisements

I installed last version of Node.js (12.2 x64 windows) After I run cmd as administrator and try to call any npm command (except npm -v) cmd window is hanging. after ctrl+c it returns Terminate batch job (Y/N)?

XmXi4.png

I was trying to left cmd for several hours but it didn't give some results. It is strange because node.exe process is consuming CPU and memory quite hard.

I was trying to reinstall node.js several times without success. I can't even get some debug information.

I faced such issue on my VM which I was using by connecting via rdp. Same version installed on my laptop works ok. On my VM I had Kaspersky antivirus, but after switching it off I got same result.

Did somebody face such issue? Is there some way to get more information problem? Could you please recommend me some way to resolve?


I've finally resolved my issue. According to suggestion from our local read me file

Node.js (with NPM) Note: On windows server machines, instead of node modules been installed at user %APPDATA% path, its better to install at a global path e.g c:\npm. This could be acheived by the npm command: $ npm config set prefix 'c:\npm' This is not required on individual developer's machine.

I've executed npm config set prefix 'c:\npm'.

As result it added prefix="'c:\\npm'" to my .npmrc file

This make node.js really crazy. It takes me about an hour to debug all these js scripts npm.js code.js etc... to find that it calls mkdirp with 'c:\npm'\etc and it loop process forever.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK