Error: npm is known not to run on Node.js V4.2.6

前端 未结 8 1692
名媛妹妹
名媛妹妹 2020-12-30 20:01

how can I solve the following error? I use Ubuntu 16. When I run any npm command such as \"npm run dev\" I get this error:

ERROR: npm is known not to

相关标签:
8条回答
  • 2020-12-30 20:26

    I fixed the same issue with Ubuntu 16.04 by using following commands step by step.

    Uninstall nodejs and install version 8.0

    $ sudo apt remove nodejs npm  
    $ curl -o- 
    https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
    $ nvm install 8.0
    $ nvm use 8.0
    $ node -v
    v8.0.0
    
    0 讨论(0)
  • 2020-12-30 20:28

    You can try downgrading the node version to switch from the bugged version using the following, upgrading also works if your app supports latest versions.

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
    
    nvm install 4.2.5
    
    nvm use 4.2.5
    
    //check with 
    node -v
    
    //To uninstall a node version 
    nvm uninstall 4.2.6
    
    0 讨论(0)
提交回复
热议问题