Error “Cannot find module 'npmlog'” after “npm update -g”

前端 未结 9 1261
轻奢々
轻奢々 2020-12-20 11:35

I have NVM 0.30.1 and used it to install node.js v5.4.0 (with NPM 3.5.4) on Fedora 22. When I run npm update -g, I receive the following warnings:



        
9条回答
  •  -上瘾入骨i
    2020-12-20 12:06

    init-package-json, node-gyp, npm-install-checks, npmlog, read-package-json didn't installed correctly. Not sure why though.

    Didn't find the root cause for the issue but I used the hacky way to install the packages above for now:

    • Roll back to the previous node version which npm didn't be updated. For example, nvm use iojs
    • cd to where npm installed, for example, cd /home/peflorencio/.nvm/versions/node/v5.4.0/lib/node_modules/npm and reinstall those packages like rm -rf node_modules/init-package-json && npm install init-package-json etc.

提交回复
热议问题