Ошибка EACESS во время установки

Во время осуществления программы я получаю следующее сообщение:

>> Local Npm module "grunt-cli" not found.

Пехотинец уже находится в системе

lrwxrwxrwx 1 root root     39 Sep 13 20:29 /usr/bin/grunt -> ../lib/node_modules/grunt-cli/bin/grunt*

Затем я хочу установить пехотинца локально с npm install -g grunt-cli, Я получаю ошибку EACCES:

$ npm install -g grunt-cli
npm ERR! Linux 3.19.0-28-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "grunt-cli"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /usr/bin/grunt
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, unlink '/usr/bin/grunt'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, unlink '/usr/bin/grunt'] errno: -13, code: 'EACCES', path: '/usr/bin/grunt' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/bin/grunt'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES, unlink '/usr/bin/grunt'] errno: -13, code: 'EACCES', path: '/usr/bin/grunt' }

npm ERR! Please include the following file with any support request:
npm ERR!     /home/skydog/npm-debug.log

Что я могу сделать для выполнения npm install -g grunt-cli без ошибки EACESS?

0
задан 14 September 2015 в 11:43

1 ответ

От man npm :

   global mode:
          npm    installs    packages   into   the   install   prefix   at
          prefix/lib/node_modules and bins are installed in prefix/bin.

   local mode:
          npm installs packages into the current project directory,  which
          defaults   to   the  current  working  directory.  Packages  are
          installed  to  ./node_modules,  and  bins   are   installed   to
          ./node_modules/.bin.

   Local mode is the default. Use --global or -g on any command to operate
   in global mode instead.

Так, когда Вы использовали эти -g флаг, Вы использовали npm в глобальном режиме. Если Вы хотите использовать локальный режим, не используйте эти -g флаг.

0
ответ дан 28 July 2019 в 15:23

Другие вопросы по тегам:

Похожие вопросы: