错误“致命错误:无法找到本地咕噜声。”在构建atom.io时

时间:2014-05-21 11:27:01

标签: gruntjs linuxmint atom-editor

我尝试构建atom.io并完成构建脚本没有任何错误。 但是,当我尝试运行" ./ grunt install"我总是得到以下错误:

grunt-cli: The grunt command line interface. (v0.1.13)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:

http://gruntjs.com/getting-started

所以我按照" http://gruntjs.com/getting-started"

的建议尝试了以下命令
sudo npm install grunt --save-dev

这提供了以下输出:

andreas@debian ~/atom.io $ sudo npm install grunt --save-dev
npm http GET https://registry.npmjs.org/grunt
npm http 304 https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/dateformat
npm http GET https://registry.npmjs.org/eventemitter2
npm http GET https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/hooker
npm http GET https://registry.npmjs.org/iconv-lite
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/exit
npm http GET https://registry.npmjs.org/js-yaml
npm http GET https://registry.npmjs.org/getobject
npm http GET https://registry.npmjs.org/grunt-legacy-util
npm http GET https://registry.npmjs.org/grunt-legacy-log
npm http 304 https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/hooker
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/eventemitter2
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/which
npm http 304 https://registry.npmjs.org/exit
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/grunt-legacy-util
npm http 304 https://registry.npmjs.org/getobject
npm http 304 https://registry.npmjs.org/grunt-legacy-log
npm http 304 https://registry.npmjs.org/dateformat
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/underscore
grunt@0.4.5 node_modules/grunt
├── dateformat@1.0.2-1.2.3
├── which@1.0.5
├── eventemitter2@0.4.13
├── getobject@0.1.0
├── rimraf@2.2.8
├── colors@0.6.2
├── async@0.1.22
├── hooker@0.2.3
├── grunt-legacy-util@0.2.0
├── exit@0.1.2
├── nopt@1.0.10 (abbrev@1.0.5)
├── lodash@0.9.2
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── iconv-lite@0.2.11
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)
├── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1)
└── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.15)

然后我运行第二个命令:

npm install

这给了我以下输出:

andreas@debian ~/atom.io $ npm install

> atom@0.97.0 preinstall /home/andreas/atom.io
> node -e 'process.exit(0)'

安装了Grunt:

andreas@debian ~/atom.io $ grunt --version
grunt-cli v0.1.13
grunt v0.4.5

但是错误并没有消失我已经google了很多但我找不到 解决这个问题的工作方案。

最好的问候

3 个答案:

答案 0 :(得分:13)

我遇到了同样的问题,npm update为我修好了

答案 1 :(得分:0)

为了从脚本目录成功运行./grunt install,您必须运行:

  

script / grunt install

来自根原子目录。

再见:)

答案 2 :(得分:0)

您需要在项目中运行此代码。

npm install grunt --save-dev