错误:服务在运行生产模式时需要workbox-sw

时间:2017-12-28 12:17:06

标签: angular jhipster

当我尝试运行以下命令时出现以下错误:

yarn run webpack:prod:main

构建日志的尾巴:

...
18081ms additional asset processing
0ms chunk asset optimization
 94% asset optimizationMergetJsonsWebpackPlugin compilation started...
MergetJsonsWebpackPlugin compilation completed...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
605ms asset optimization
95% emittingMergetJsonsWebpackPlugin emit starts...
MergetJsonsWebpackPlugin emit completed...
MergetJsonsWebpackPlugin emit starts...
MergetJsonsWebpackPlugin emit completed...
MergetJsonsWebpackPlugin emit starts...
MergetJsonsWebpackPlugin emit completed...
Error: workbox-sw is needed by the service worker and could not be copied     
over to your new site. Error: ENOENT: no such file or directory, chmod ' 
\target\www\workbox-sw.prod.v2.1.2.js'
at Error (native)
at Promise.all.then.catch ( \node_modules\workbox-
build\build\lib\utils\copy-workbox-sw.js:17:13)
error Command failed with exit code 1.
error Command failed with exit code 1.

以下命令有效,但/app/vendor.bundle.js太大(~12Mb)

yarn run webpack:build

解决方案:(已在即将推出的jHipster版中修复)

http://www.jhipster.tech/2017/12/27/jhipster-release-4.13.1.html

1 个答案:

答案 0 :(得分:0)

这是来自v 4.13的jHispter的错误。它在4.13.1

中修复

http://www.jhipster.tech/2017/12/27/jhipster-release-4.13.1.html