【问题标题】:Grunt Build creates broken appGrunt Build 创建损坏的应用程序
【发布时间】:2016-08-02 09:04:41
【问题描述】:

我使用 Yeoman 作为项目启动器制作了一个 AngularJS Web 应用程序。

启动以下命令:

grunt serve

一切正常。

如果我尝试测试用于生产的 dist 版本,请使用以下命令:

grunt serve:dist

我在浏览器控制台中遇到这样的错误:

    vendor.f13d432c.js:1 Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module uuid4 due to:
Error: [$injector:nomod] Module 'uuid4' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

怎么了?

编辑

同样的情况发生在:

grunt build

然后将 dist 文件夹部署到网络服务器中

【问题讨论】:

    标签: angularjs build gruntjs yeoman


    【解决方案1】:

    你试过跑步吗:

    npm install
    

    显然,缺少“uuid4”。这是一个 npm 包,所以你可能仍然需要包含它,运行 npm install。

    【讨论】:

    • 刚刚尝试运行该命令,但没有任何改变。奇怪的是,未缩小的版本可以正常工作(grunt serve),但 dist 版本不能正常工作(grunt serve:dist)。
    猜你喜欢
    • 1970-01-01
    • 2022-06-29
    • 1970-01-01
    • 1970-01-01
    • 2017-03-01
    • 2011-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多