大佬教程收集整理的这篇文章主要介绍了node.js – 如何在不出错的情况下安装grunt-cli?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
首先,我安装了Node.
然后我将package.json文件添加到我的项目根目录,包括:
{ "name": "example-project","version": "0.1.0","devDependencies": { "grunt": "~0.4.1" } }
然后我运行了npm install
最后,我运行了npm install -g grunt-cli
它带来了大量的错误:
npm http GET https://registry.npmjs.org/grunt-cli npm http 304 https://registry.npmjs.org/grunt-cli npm ERR! Error: EACCES,mkdir '/usr/local/lib/node_modules/grunt-cli' npm ERR! { [Error: EACCES,mkdir '/usr/local/lib/node_modules/grunt-cli'] npm ERR! errno: 3,npm ERR! code: 'EACCES',npm ERR! path: '/usr/local/lib/node_modules/grunt-cli',npm ERR! fstream_type: 'Directory',npm ERR! fstream_path: '/usr/local/lib/node_modules/grunt-cli',npm ERR! fstream_class: 'DirWriter',npm ERR! fstream_stack: npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',npm ERR! 'Object.oncomplete (fs.js:107:15)' ] } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Darwin 11.4.2 npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli" npm ERR! cwd /Users/bryce/repo npm ERR! node -v v0.10.23 npm ERR! npm -v 1.3.17 npm ERR! path /usr/local/lib/node_modules/grunt-cli npm ERR! fstream_path /usr/local/lib/node_modules/grunt-cli npm ERR! fstream_type Directory npm ERR! fstream_class DirWriter npm ERR! code EACCES npm ERR! errno 3 npm ERR! stack Error: EACCES,mkdir '/usr/local/lib/node_modules/grunt-cli' npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23 npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53 npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/bryce/repo/npm-debug.log npm ERR! not ok @R_494_6756@ Bryce:repo bryce$npm install -g grunt-cli npm http GET https://registry.npmjs.org/grunt-cli npm http 304 https://registry.npmjs.org/grunt-cli npm ERR! Error: EACCES,mkdir '/usr/local/lib/node_modules/grunt-cli' npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23 npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53 npm ERR! fstream_stack Object.oncomplete (fs.js:107:15) npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/bryce/repo/npm-debug.log npm ERR! not ok @R_494_6756@
我假设上述错误是我尝试运行grunt的原因,我只是得到-bash:grunt:command not found
那里的任何人都知道发生了什么事吗?
以上是大佬教程为你收集整理的node.js – 如何在不出错的情况下安装grunt-cli?全部内容,希望文章能够帮你解决node.js – 如何在不出错的情况下安装grunt-cli?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。