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

问题描述 投票:0回答:1

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

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

angular jhipster
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.