Не удается установить yeoman, потому что «Не удалось найти двоичный файл yo. Убедитесь, что он установлен и находится в вашем $ PATH» - PullRequest
0 голосов
/ 09 июля 2020

Итак, я пытаюсь установить yeoman, но он дает мне следующее:

npm install -g yo generator-code
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/Users/X/.npm-global/bin/yo -> /Users/X/.npm-global/lib/node_modules/yo/lib/cli.js
/Users/X/.npm-global/bin/yo-complete -> /Users/X/.npm-global/lib/node_modules/yo/lib/completion/index.js

> yo@3.1.1 postinstall /Users/X/.npm-global/lib/node_modules/yo
> yodoctor


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
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'
}
✔ npm version

Found potential issues on your machine :(
+ yo@3.1.1
+ generator-code@1.2.19
updated 2 packages in 23.236s
NOHpc02:~ William$ npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.
NOHpc02:~ William$ sudo npm install -g yo
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
/Users/William/.npm-global/bin/yo -> /Users/William/.npm-global/lib/node_modules/yo/lib/cli.js
/Users/William/.npm-global/bin/yo-complete -> /Users/William/.npm-global/lib/node_modules/yo/lib/completion/index.js

> yo@3.1.1 postinstall /Users/William/.npm-global/lib/node_modules/yo
> yodoctor


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
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'
}
✔ npm version

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

Я искал и искал, но ни один из ответов, данных другими на тот же вопрос, не помог мне.

  • Я сделал npm install -g yeoman-doctor. не сработало.
  • Я пробовал запустить sudo npm install -g yo generator-code. не работает.
  • Я попытался создать двоичный файл yo вручную, но не смог найти никакой информации о том, как это сделать.

Мой java обновлен, как и мой node.js. Я использую MacOS Catalina 10.15.5. Заранее спасибо.

...