简体   繁体   English

约曼角发电机寻找本地咕unt声

[英]Yeoman angular generator looking for local grunt

im trying to create on my linux environment the yeoman angular generator, whenever i execute yo angular webapp , an error on the output that says 我试图在我的Linux环境上创建yeoman角度生成器,每当我执行yo angular webapp ,输出错误说

Fatal error: Unable to find local grunt. 致命错误:无法找到本地咕unt声。

and when i search for grunt on my linux environment via find / -name "grunt" this is the output 当我通过find / -name "grunt"在我的linux环境中搜索grunt ,这是输出

/root/.npm/registry.npmjs.org/grunt /root/.npm/grunt /root/sites/node_modules/grunt /root/sites/node_modules/grunt/lib/grunt /tmp/npm-2302-5b275c10/registry.npmjs.org/grunt /tmp/npm-11975-b7813b65/registry.npmjs.org/grunt /usr/bin/grunt /usr/lib/node_modules/grunt /usr/lib/node_modules/grunt/bin/grunt /usr/lib/node_modules/grunt/lib/grunt /usr/lib/node_modules/grunt-cli/bin/grunt /root/.npm/registry.npmjs.org/grunt /root/.npm/grunt / root / sites / node_modules / grunt / root / sites / node_modules / grunt / lib / grunt / tmp / npm-2302-5b275c10 / registry .npmjs.org / grunt /tmp/npm-11975-b7813b65/registry.npmjs.org/grunt / usr / bin / grunt / usr / lib / node_modules / grunt / usr / lib / node_modules / grunt / bin / grunt / usr / lib / node_modules / grunt / lib / grunt / usr / lib / node_modules / grunt-cli / bin / grunt

Now, im confused because i've installed Grunt globally how come it will search it for the local copy, why not use the global grunt i just installed? 现在,我很困惑,因为我已经在全球范围内安装了Grunt,为什么会在本地副本中搜索它,为什么不使用我刚安装的全局Grunt?

The grunt documentation say that grunt has to be installed in the project. grunt文档说必须在项目中安装grunt。

The yeoman generator don't install the grunt directly in the project yeoman生成器不要在项目中直接安装grunt

To solve your issue only do : 要解决您的问题,请执行以下操作:

sudo npm install grunt --save-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM