sudo: npm: command not found

前端 未结 25 2672
渐次进展
渐次进展 2020-11-28 01:19

I\'m trying to upgrade to the latest version of node. I\'m following the instructions at http://davidwalsh.name/upgrade-nodejs

But when I do:

sudo np         


        
25条回答
  •  难免孤独
    2020-11-28 01:47

    In order to install npm packages globally with sudo permission, /usr/bin/npm should be available. If npm exists on some other directory, create a soft link like:

    sudo ln -s /usr/local/bin/npm /usr/bin/npm
    

    It works on Fedora 25, node8.0.0 and npm5.0.0

提交回复
热议问题