今天升级了Angular-cli版本到:Angular CLI: 6.2.4 后,初始化了个新项目,cnpm install 安装好依赖后 ng serve 报错。

报错信息如下:

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **95% emitting LicenseWebpackPlugin(node:21768) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'D:\me\angular\ngApp\node_modules\_@angular_common@6.1.0@@angular\package.json'at Object.fs.openSync (fs.js:646:18)at Object.fs.readFileSync (fs.js:551:33)at LicenseExtractor.readPackageJson (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\LicenseExtractor.js:126:23)at LicenseExtractor.parsePackage (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\LicenseExtractor.js:23:32)at ModuleProcessor.processPackage (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\ModuleProcessor.js:44:46)at ModuleProcessor.processFile (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\ModuleProcessor.js:41:21)at fileCallback (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\LicenseWebpackPlugin.js:107:61)at moduleCallback (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\LicenseWebpackPlugin.js:114:21)at D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\LicenseWebpackPlugin.js:126:29at Array.forEach (<anonymous>)at emitCallback (D:\me\angular\ngApp\node_modules\_license-webpack-plugin@1.5.0@license-webpack-plugin\dist\LicenseWebpackPlugin.js:92:32)at _err0 (eval at create (D:\me\angular\ngApp\node_modules\_tapable@1.1.0@tapable\lib\HookCodeFactory.js:32:10), <anonymous>:19:1)at callback (D:\me\angular\ngApp\node_modules\_copy-webpack-plugin@4.5.2@copy-webpack-plugin\dist\index.js:77:17)at D:\me\angular\ngApp\node_modules\_copy-webpack-plugin@4.5.2@copy-webpack-plugin\dist\index.js:118:24at <anonymous>
(node:21768) 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:21768) [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.

在各种百度、谷歌、stack overfolw后解决方法:

(1)第一种解决办法:使用yarn代替cnpm安装依赖包

然后使用yarn遇到了一连串的问题,解决方法和安装使用方法请参考我的另一篇博文:《yarn踩坑记录》

最后 ng serve 成功运行:

D:\me\angular\ng-app>ng serve
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **Date: 2018-10-10T02:12:20.302Z
Hash: 239e5b9b82b5dbe931da
Time: 10477ms
chunk {main} main.js, main.js.map (main) 10.7 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 227 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 15.6 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.28 MB [initial] [rendered]
i 「wdm」: Compiled successfully.

(2)第二种解决方法:使用npm 代替cnpm安装依赖包

D:\me\angular\ng-app>npm install

个人来说还是推荐第一种使用yarn来安装依赖包,yarn的使用方法和npm大同小异;但是第二种使用npm安装的方式,在有vpn的条件下还是不错的,不然等待你的将会是一大堆安装失败、警告的报错信息。

ng serve 报错: 95% emitting LicenseWebpackPlugin(node:21768) UnhandledPromiseRejectionWarning…相关推荐

  1. ng serve报错An unhandled exception occurred: Cannot find module '@angular-devkit/build-webpack'

    报错后无法正常启动 尝试通过cnpm install解决,虽然命令执行成功,但是并没有效果 执行rm -r -force node_modules 在重新执行cnpm install 报另外的错 执行 ...

  2. ng serve报错An unhandled exception occurred: Cannot find module ‘@angular-devkit/build-webpack‘

    报错后无法正常启动 尝试通过cnpm install解决,虽然命令执行成功,但是并没有效果 执行rm -r -force node_modules 在重新执行cnpm install 报另外的错 执行 ...

  3. Angular6项目运行到95%emitting LicenseWebpackPlugin不动卡住

    将angular版本跟新到6.0.6,新建angular项目突然无法运行了,我新建项目步骤如下: ng new demo cd demo ng serve --open 运行结果如下,程序一直卡在95 ...

  4. npm run serve 报错:Error: error:0308010C:digital envelope routines::unsupported

    项目场景: vue项目npm install之后运行报错 问题描述 npm run serve 报错:Error: error:0308010C:digital envelope routines:: ...

  5. npm run serve 报错问题 (npm ERR! code ELIFECYCLE)

    记录:npm run serve 报错问题 差点被整吐了,恶心到我了 解决方法 参考的大佬 运行 npm cache clean --force 删除 node_modules 删除 package- ...

  6. npm run serve 报错

    npm run serve 报错如下: 第一种情况: 那么遇到这种情况不用慌,因为你所在的目录不对,你没有在你所运行的vue项目中运行npm run serve,那么就需要切换到该文件夹目录下 ,然后 ...

  7. 【Flink】Flink写入es报错failed to get node info for request_id time out out after

    1.美图 2.背景 windows下开发flink程序,连接本地的es,启动的时候报错如下,重启一下es就好了. INFO [elasticsearch[_ client_ _] [generic] ...

  8. vue3运行npm run serve报错ERROR Error: Cannot find module ‘babel-plugin-import‘ Require stack:

    1.完整报错` > ims-support-demo@0.1.0 serve /Users/yizhikaixinya/Desktop/charmplus-ims > vue-cli-se ...

  9. vue cli可视化面板运行serve报错:Error: Package exports for ‘D:\*******(路径)\node_modules\colorette‘ do not defi

    用vue-cli创建了一个新项目,运行serve时报错:Error: Package exports for 'D:*******(路径)\node_modules\colorette' do not ...

最新文章

  1. 大型网站演化发展历程之三
  2. 【百家稷学】深度学习在计算摄影中的方法与应用(vivo技术分享)
  3. 使用mybatis-generator-core实现自动创建项目
  4. SAP License:SAP一个成功的案例之跳槽者必看
  5. JavaEE学习11--数据库语言SQL
  6. 一年成为ai算法工程师_我作为一名数据科学研究员所学到的东西在一年内成为了AI领导者...
  7. 扩展欧几里得算法求逆元c语言,利用扩展欧几里得算法编程求逆元
  8. SolidWorks转3DMAX再到Unity3D的转换模型及单位设置
  9. apollo简易高精度地图制作
  10. Oracle dmp文件解析
  11. WebGL默认全屏显示
  12. android 屏蔽系统输入法自定义输入法的详解
  13. 如何升级Vue的版本 vue2.9.6升级到vue3.0
  14. MacOS Xcode与Swift版本对应关系
  15. linux bind教程,Linux Bind系列视频教程(小耗子出品22集)
  16. qml 中的function怎么加类型_皮炎有哪些类型?生活中皮炎要怎么预防?得了皮炎要注意哪些问题...
  17. Elasticsearch摄取节点(三)——管道处理器(Processor)介绍
  18. [收藏] FC交换机基础知识详解
  19. VM虚拟机黑苹果无法启动
  20. android ble notify,Android Ble notify功能踩坑

热门文章

  1. appium startActivity使用方法
  2. uniapp的项目,scss和js实现跑马灯
  3. 助力无人船舶,开拓水上智能
  4. html怎么用img添加图片,img标签(html怎么用img添加图片)
  5. vue的entries和nextTick
  6. API 接口应该如何设计?如何保证安全?如何签名?如何防重?
  7. 软件测试--如何把5M图片变成10M图片
  8. 手机游戏可以投屏吗?手机游戏怎么投屏到电脑?
  9. 华为云图像标签使用之智慧相册
  10. android模拟器玩手游,电脑上玩手游PC安卓模拟器哪个好用?哪个手机模拟器最好...