Angular CLI 升级 6.0 之后遇到的问题
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Angular CLI 升级 6.0 之后遇到的问题,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3032字,纯文字阅读大概需要5分钟。
内容图文
![Angular CLI 升级 6.0 之后遇到的问题](/upload/InfoBanner/zyjiaocheng/1306/801c122615e54a578397cb8e0909033e.jpg)
Angular CLI 1.7.4 在使用 ng build --prod
会构建失败,而 ng build
是正常的。比较好的解决办法是使用 ng build --prod --extract-license=false
或者 ng build --prod --no-extract-license
。
最近将 Angular CLI 升级到 6.X 之后,直接 ng build
会报以下错误,ng serve
也是如此。
95% emitting LicenseWebpackPlugin(node:6252) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'D:\X\project\Angular-examples\angular-test\node_modules\_@angular_common@6.0.2@@angular\package.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at LicenseExtractor.readPackageJson (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\LicenseExtractor.js:126:23)
at LicenseExtractor.parsePackage (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\LicenseExtractor.js:23:32)
at ModuleProcessor.processPackage (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\ModuleProcessor.js:39:46)
at ModuleProcessor.processFile (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\ModuleProcessor.js:36:21)
at fileCallback (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\LicenseWebpackPlugin.js:101:61)
at moduleCallback (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\LicenseWebpackPlugin.js:108:21)
at D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\LicenseWebpackPlugin.js:120:29
at Array.forEach (<anonymous>)
at emitCallback (D:\X\project\Angular-examples\angular-test\node_modules\_license-webpack-plugin@1.3.1@license-webpack-plugin\dist\LicenseWebpackPlugin.js:86:32)
at _err0 (eval at create (D:\X\project\Angular-examples\angular-test\node_modules\_tapable@1.0.0@tapable\lib\HookCodeFactory.js:24:12), <anonymous>:19:1)
at callback (D:\X\project\Angular-examples\angular-test\node_modules\_copy-webpack-plugin@4.5.1@copy-webpack-plugin\dist\index.js:77:17)
at D:\X\project\Angular-examples\angular-test\node_modules\_copy-webpack-plugin@4.5.1@copy-webpack-plugin\dist\index.js:118:24
at <anonymous>
(node:6252) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6252) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
但是使用 ng build --prod
是正常的。同样地,使用 ng build --extract-license=false
也可以解决问题。
简单看一下,问题是由 license-webpack-plugin
插件引起的。这款插件用于输出第三方插件的许可协议。老外比较重视版权吧。但是不知道为什么总是在这个地方出问题。
原文:https://www.cnblogs.com/nzbin/p/9050537.html
内容总结
以上是互联网集市为您收集整理的Angular CLI 升级 6.0 之后遇到的问题全部内容,希望文章能够帮你解决Angular CLI 升级 6.0 之后遇到的问题所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。