Как установить Yoeman на Ubuntu18.04 - PullRequest
0 голосов
/ 25 апреля 2020

Я устанавливаю Yeoman на мою машину и запустил это npm install -g yo Это дает мне ошибку разрешения:

npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'] {
npm ERR!   stack: "Error: EACCES: permission denied, access '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/nvm/versions/node/v12.16.1/lib/node_modules/yo'
npm ERR! }
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/siddharth/.npm/_logs/2020-04-24T22_31_29_025Z-debug.log

Но это удалось решить, прикрепив sudo

Теперь я получаю эту ошибку:

Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn yo',
  path: 'yo',
  spawnargs: [ '--version' ],
  cmd: 'yo --version'
}
✖ yo version
Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn yo',
  path: 'yo',
  spawnargs: [ '--version' ],
  cmd: 'yo --version'
}

Found potential issues on your machine :(
+ yo@3.1.1
updated 1 package in 29.492s

Запуск yo --version дает zsh: command not found: yo Я пробовал это { ссылка }, но это также не работает для меня:, (

...