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

前端 未结 9 1265
轻奢々
轻奢々 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条回答
  •  一生所求
    2020-12-20 11:43

    There is an option to bump npm without reinstalling node.

    #### # this will remove current npm
    rm -rf /usr/local/lib/node_modules/npm/
    
    #### # install npm from sources. Version 3.5.x will be installed
    apt-get update
    apt-get install npm
    
    #### # install the newest npm version. Bumping from 3.5.X to 6.14.X goes without any issue :)
    /usr/bin/npm install npm@latest -g
    
    #### # additionally, npm with version 3.5.x is not added to $PATH, so it's not used.
    

提交回复
热议问题