【发布时间】:2013-05-01 19:55:40
【问题描述】:
我正在尝试安装grunt.js。正如official docs 所说,我应该跑
npm install -g grunt-cli
以 root 身份(我使用的是 ubuntu linux)。我正在尝试 - 我收到以下错误:
$ sudo npm install -g grunt-cli
npm ERR! sudon't!
npm ERR! sudon't! Running npm as root is not recommended!
npm ERR! sudon't! Seriously, don't do this!
npm ERR! sudon't!
npm ERR! couldn't read package.json in .
npm ERR! Error installing .
npm ERR! Error: ENOENT, No such file or directory 'package.json'
npm ERR! Report this *entire* log at <http://github.com/isaacs/npm/issues>
npm ERR! or email it to <npm-@googlegroups.com>
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok
谁能解释一下:
[1] why npm says `sudon't` and grunt docs says `do sudo`? And what is it all about?
[2] I want to install the grunt as a tool. Why does the message complains about missing package.json which is project-dependent (and I don't want to run grunt on any project, I want to install it globally first)?
[3] what can I do to make it install successfully?
【问题讨论】:
-
您使用的是什么节点版本?好像很久以前就修复了:stackoverflow.com/questions/4938592/…
-
0.4.9 来自 oneiric ocelot 包。好吧,我不太明白这到底是怎么回事,但我只想安装
grunt.js...