gpt4 book ai didi

node.js - 无法让 Yeoman 正常工作

转载 作者:太空宇宙 更新时间:2023-11-04 00:42:26 24 4
gpt4 key购买 nike

我无法让 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

有人可以帮助我找出为什么我无法使其正常工作以及如何解决它吗?我们将不胜感激。

最佳答案

解决了问题。

按照以下步骤完全卸载 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 教程。现在一切正常!

关于node.js - 无法让 Yeoman 正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36102464/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com