我使用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
然后在Web服务器中部署dist文件夹
你试过运行吗
npm install
显然,"uuid4"不见了。这是一个npm软件包,所以你可能仍然需要包括它,运行npm安装。