sudo: npm: command not found

前端 未结 25 2663
渐次进展
渐次进展 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:53

    Since I have installed node.js using .tar file available on node.js, I had to put the location of the node directory on:

    ~/.bashrc

    of root by changing from normal user to root using command:

    sudo -i

    then I had to add the path to node where I extracted it into .bashrc file as below:

    then refereshed .bashrc using

    . ~/.bashrc

    there after

    npm: command not found
    

    went away

提交回复
热议问题