npm install not installing things at /usr/bin

前端 未结 2 1097
天涯浪人
天涯浪人 2020-12-18 08:39

I am trying to install SailsJS with:

$ sudo npm install -g sails

It works, install everything at /home/brunoluiz/npm/lib/node_modules/sails

2条回答
  •  无人及你
    2020-12-18 08:54

    In addition to mklement0's answer, the first solution (adding the npm binary directory path to the PATH variable) creates another problem when the commands are run with sudo prefix on Linux environment. To solve it, the npm binary directory path must also be added in secure_path in /etc/sudoers.tmp. Here is how: Why can't sudo find a command after I added it to PATH?

提交回复
热议问题