【问题标题】:Yeoman angular generator looking for local gruntYeoman 角度发生器寻找当地的咕噜声
【发布时间】:2016-11-27 05:55:34
【问题描述】:

我试图在我的 linux 环境中创建 yeoman 角度生成器,每当我执行 yo angular webapp 时,输出就会出现错误提示

致命错误:无法找到本地咕噜声。

当我通过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/咕噜声 /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

现在,我很困惑,因为我已经全局安装了 Grunt,为什么它会搜索本地副本,为什么不使用我刚刚安装的全局 grunt?

【问题讨论】:

    标签: angularjs node.js gruntjs yeoman


    【解决方案1】:

    grunt 文档说 grunt 必须安装在项目中。

    yeoman 生成器不会直接在项目中安装 grunt

    要解决您的问题,只需:

    sudo npm install grunt --save-dev
    

    【讨论】:

    • 你好,谢谢,是的,我已经尝试过这样做,但是需要很多 grunt 依赖项.. 我尝试一一安装它们。但是让 grunt 的所有依赖项在本地都不可用是不是很不寻常?我的意思是当我执行那个命令时,当我执行'yo angular webapp'时它会自动解决它的依赖关系会更好吗?
    • 尝试在项目中安装 bower 和/或 npm 吗?如果它仍然没有运行,你可以:清理 npm 缓存 npm cache clean 然后他们重试该过程
    猜你喜欢
    • 2013-03-15
    • 1970-01-01
    • 2013-12-24
    • 2014-07-25
    • 2015-05-25
    • 1970-01-01
    • 1970-01-01
    • 2017-04-30
    • 2018-04-18
    相关资源
    最近更新 更多