Я пытаюсь установить grunt.js. Как official docs говорит, я должен работатьошибка при установке gruntjs (node.js/npm package)
npm install -g grunt-cli
как корень (я использую 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 <[email protected]>
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?
Какую версию узла вы используете? Похоже, что это было исправлено давным-давно: http://stackoverflow.com/questions/4938592/how-why-does-npm-recommend-not-running-as-root – jgillich
0.4.9 из одноразовых пакетов ocelot. Ну, я не совсем понимаю, что это такое, но я просто хочу установить 'grunt.js' ... – ducin