我有一个不错的应用程序,它运行良好,但突然决定无法编译。这是我收到的消息:
ng build --prod
10% building modules 3/6 modules 3 active ...ogress\kendo-theme-default\dist\all.cssBrowserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite bro
wserslist`
Date: 2019-11-19T07:21:29.683Z
Hash: bc5a2bd03beaf378e3ec
Time: 144175ms
chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.2361f2ce96bc4995205c.js (main) 2.41 MB [initial] [rendered]
chunk {2} polyfills.3bfd66addbd0d2814591.js (polyfills) 41 kB [initial] [rendered]
chunk {3} styles.1c00e622ff426742cef7.css (styles) 724 kB [initial] [rendered]
ERROR in ./node_modules/@progress/kendo-angular-grid/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../../kendo-angular-dateinputs/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos
\RDPortal\node_modules\@progress\kendo-angular-grid\dist\es2015'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-buttons/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\s
faus\Source\Repos\RDPortal\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-dateinputs/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\User
s\sfaus\Source\Repos\RDPortal\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-menu/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfau
s\Source\Repos\RDPortal\src\app'
ERROR in ./node_modules/@progress/kendo-angular-dateinputs/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos\RDPortal\node_modules\@prog
ress\kendo-angular-dateinputs\dist\es2015'
ERROR in ./node_modules/@progress/kendo-angular-menu/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos\RDPortal\node_modules\@prog
ress\kendo-angular-menu\dist\es2015'
ERROR in ./node_modules/@progress/kendo-angular-tooltip/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos\RDPortal\node_modules\@prog
ress\kendo-angular-tooltip\dist\es2015'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-tooltip/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\s
faus\Source\Repos\RDPortal\src\app'
这运行得很好,我让它在localhost上的ng serve下运行,并且一切正常。然后,我尝试为生产进行构建,然后得到了这个。自上次构建生产以来,我没有在生产环境文件中进行任何更改。我什至尝试删除节点模块并重新运行npm install来还原它们,但结果相同。
这里发生了什么,我将如何解决?
编辑我确实检查了一些被引用的文件,但它们似乎不存在,但是我如何找回它们呢?恢复软件包似乎没有完成...
编辑
运行npm,我已稍微减少了错误,但无法完全解决。我已经在所有提及的内容上运行了它,但它并未删除。这也只是生产,当我运行没有生产标签的构建时,它就可以工作。这是生产和非生产版本的新输出:
C:\Users\sfaus\Source\Repos\RDPortal>ng build
10% building modules 7/10 modules 3 active ...ogress\kendo-theme-default\dist\all.cssBrowserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite br
owserslist`
Date: 2019-11-19T08:09:27.718Z
Hash: 2ca9dcb925d7fa584a1a
Time: 42133ms
chunk {main} main.js, main.js.map (main) 431 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 237 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 2.78 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 11 MB [initial] [rendered]
C:\Users\sfaus\Source\Repos\RDPortal>ng build --prod
10% building modules 3/6 modules 3 active ...ogress\kendo-theme-default\dist\all.cssBrowserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite bro
wserslist`
Date: 2019-11-19T08:11:17.991Z
Hash: d2c32d39e1014b497186
Time: 88276ms
chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.de70829e5adffe6eae72.js (main) 2.42 MB [initial] [rendered]
chunk {2} polyfills.3bfd66addbd0d2814591.js (polyfills) 41 kB [initial] [rendered]
chunk {3} styles.1c00e622ff426742cef7.css (styles) 724 kB [initial] [rendered]
ERROR in ./node_modules/@progress/kendo-angular-grid/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../../kendo-angular-dateinputs/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos
\RDPortal\node_modules\@progress\kendo-angular-grid\dist\es2015'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-buttons/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\s
faus\Source\Repos\RDPortal\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-dateinputs/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\User
s\sfaus\Source\Repos\RDPortal\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-menu/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfau
s\Source\Repos\RDPortal\src\app'
ERROR in ./node_modules/@progress/kendo-angular-dateinputs/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos\RDPortal\node_modules\@prog
ress\kendo-angular-dateinputs\dist\es2015'
ERROR in ./node_modules/@progress/kendo-angular-menu/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos\RDPortal\node_modules\@prog
ress\kendo-angular-menu\dist\es2015'
ERROR in ./node_modules/@progress/kendo-angular-tooltip/dist/es2015/index.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\sfaus\Source\Repos\RDPortal\node_modules\@prog
ress\kendo-angular-tooltip\dist\es2015'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../node_modules/@progress/kendo-angular-tooltip/node_modules/@progress/kendo-angular-popup/dist/es2015/index.ngfactory' in 'C:\Users\s
faus\Source\Repos\RDPortal\src\app'
好吧,尽管我仍然不完全了解发生了什么。该修复程序最终成为注释中讨论的更复杂版本。我找到了this page,并从中运行了npx npm-check-updates -u -f /^@progress/
,然后是npm install --save @progress/kendo-angular-common @progress/kendo-angular-popup
。那给我留下的只是在1个软件包上显示一个错误(一个PDF导出器,我不认为我正在使用...)。我能够在该软件包上运行npm安装,然后最终再次构建。
[如果有人对发生的事情有很好的解释,我很乐意接受您的回答,但是如果有任何帮助,可以把它留在这里。