无法让Yeoman正常工作

时间:2016-03-19 13:39:26

标签: node.js macos npm yeoman

我不能让Yeoman设置为我的生活而工作。

当我尝试运行以下内容时:

Aidans-MacBook-Pro:~ aidan$ npm install --global yo bower grunt-cli

但是我最终得到以下内容(当我尝试检查版本时,似乎只安装了Yeoman):

npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN checkPermissions Missing write access to /Users/aidan/.npm-packages/lib/node_modules/bower
- minimatch@3.0.0 node_modules/yo/node_modules/glob/node_modules/minimatch
- lru-cache@2.7.3 node_modules/yo/node_modules/minimatch/node_modules/lru-cache
- sigmund@1.0.1 node_modules/yo/node_modules/sigmund
/Users/aidan/.npm-packages/lib
├── bower@1.7.7 
├── grunt-cli@0.1.13 
└─┬ yo@1.7.0 
  └─┬ yeoman-doctor@2.1.0
    └─┬ twig@0.8.9 
      └── minimatch@3.0.0 

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/Users/aidan/.node/bin/npm" "install" "--global" "yo" "bower" "grunt-cli"
npm ERR! node v4.4.0
npm ERR! npm  v3.8.1
npm ERR! path /Users/aidan/.npm-packages/lib/node_modules/bower
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/Users/aidan/.npm-packages/lib/node_modules/bower'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, access '/Users/aidan/.npm-packages/lib/node_modules/bower']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/Users/aidan/.npm-packages/lib/node_modules/bower' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/aidan/npm-debug.log
Aidans-MacBook-Pro:~ aidan$ yo --version
1.7.0
Aidans-MacBook-Pro:~ aidan$ bower --version
-bash: bower: command not found
Aidans-MacBook-Pro:~ aidan$ grunt --version
-bash: grunt: command not found
Aidans-MacBook-Pro:~ aidan$ 

我已经尝试过本指南,但没有运气: https://gist.github.com/DanHerbert/9520689

使用Mac OS X El Capitan 10.11.3

有人可以协助我弄清楚为什么我无法使这个工作,以及如何解决它?非常感谢。

2 个答案:

答案 0 :(得分:1)

解决了问题。

通过以下方式完全卸载Node / NPM / etc: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

然后通过安装程序安装Node.js,然后按照此页面(视频): https://docs.npmjs.com/getting-started/fixing-npm-permissions

然后开始了Yeoman教程。现在一切正常!

答案 1 :(得分:0)

您遇到权限问题。在安装过程中,问题以EACCESS错误的形式出现。请参阅npm guide to fix permissions