npm hangs on any command

后端 未结 6 1079
庸人自扰
庸人自扰 2021-01-01 20:01

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

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 20:22

    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.

提交回复
热议问题