Ссылка на npm: «Файл существует: / usr / local / bin / compile» - PullRequest
0 голосов
/ 02 июля 2019

Я строю кли. Я хочу связать Cli с моим проектом, чтобы я мог проверить его. Я получаю эту ошибку при запуске npm link:

$ npm link

npm ERR! path /Users/jacksonmooring/Desktop/compiBot
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '/Users/jacksonmooring/Desktop/compiBot' -> '/usr/local/lib/node_modules/compi-bot'
npm ERR!  { [Error: EACCES: permission denied, symlink '/Users/jacksonmooring/Desktop/compiBot' -> '/usr/local/lib/node_modules/compi-bot']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, symlink \'/Users/jacksonmooring/Desktop/compiBot\' -> \'/usr/local/lib/node_modules/compi-bot\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '/Users/jacksonmooring/Desktop/compiBot',
npm ERR!   dest: '/usr/local/lib/node_modules/compi-bot' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jacksonmooring/.npm/_logs/2019-07-02T01_47_32_775Z-debug.log

Поэтому я повторяю попытку, используя sudo npm link, и получаю эту ошибку:

sudo npm link
Password:
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN compi-bot@1.0.0 No description
npm WARN compi-bot@1.0.0 No repository field.

up to date in 3.022s
found 0 vulnerabilities

npm ERR! path /usr/local/bin/compile
npm ERR! code EEXIST
npm ERR! Refusing to delete /usr/local/bin/compile: ../lib/node_modules/cli/cli.js symlink target is not controlled by npm /usr/local/bin
npm ERR! File exists: /usr/local/bin/compile
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jacksonmooring/.npm/_logs/2019-07-02T01_48_11_041Z-debug.log
...