npm throws error without sudo

前端 未结 30 1985
清酒与你
清酒与你 2020-11-21 07:43

I just installed node and npm through the package on nodejs.org and whenever I try to search or install something with npm it throws the following error, unless I sudo the c

30条回答
  •  一整个雨季
    2020-11-21 08:09

    @Yves M.'s answer was very similar to my solution. Here are the commands I used, which were slightly different from his.

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
    

    Then query for the latest version:

    nvm ls-remote
    

    Then install the newest version:

    nvm install YOUR_VERSION_HERE
    

    example

    nvm install v5.8.0
    

提交回复
热议问题