2013-05-07 2 views
0

grunt.js을 설치하려고합니다. official docs 말한다, 나는 (내가 우분투 리눅스를 사용하고 있습니다) 루트로gruntjs (node.js/npm 패키지)를 설치하는 동안 오류가 발생했습니다.

npm install -g grunt-cli 

를 실행해야합니다. 나는 시도하고있다 - 나는 다음과 같은 오류 얻을 : 아직도있는이 솔루션은 ... 내가 우분투를 oneiric 오셀롯을 매우 까다로운 사용하고 있었다

[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? 
+0

어떤 노드 버전을 사용하고 있습니까? 이것은 오래전에 고쳐 졌던 것 같습니다 : http://stackoverflow.com/questions/4938592/how-why-does-npm-recommend-not-running-as-root – jgillich

+0

0.4.9 oneiric ocelot packages. 글쎄, 나는 그것이 무엇인지 완전히 이해하지 못한다. 그러나 나는 단지'grunt.js'를 설치하려고한다. – ducin

답변

0

:

$ 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 

누군가가 설명해 주시겠습니까를 일주일 전에 유지되었습니다 (오래되지 않았습니다). 기본 우분투 패키지를 통해 node.js를 설치했는데 문제가되는 것으로 판명되었습니다. 이전에 node.js에 대한 경험이 없었기 때문에 이상하고 이상한 것으로 보이는 0.4.9 버전이 설치되어 있습니다. 나는 그것을 제거하고 https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager에서 지시를 따랐다 - 원격 패키지 저장소를 추가하고 거기에서 node.js를 설치했다. 이제는 불만없이 완벽하게 작동하는 sudo npm install으로 반짝이는 0.10.5을 얻었습니다.

관련 문제