angular2报错


1、运行ng serve的时候卡在95% emitting LicenseWebpackPlugin

放弃使用cnpm,使用yarn
删除node_modules (不需要删除project目录重新ng new)

安装yarn:npm install --global yarn

配置仓库:

npm config set registry http://registry.npmjs.org/

yarn config set registry https://registry.yarnpkg.com/

如果用淘宝仓库:

npm config set registry https://registry.npm.taobao.org

yarn config set registry https://registry.npm.taobao.org

新建项目:ng new project --skip-install

安装依赖:进入project目录运行 yarn install

2、报错Local workspace file ('angular.json') could not be found.

Error: Local workspace file ('angular.json') could not be found.

执行sudo ng update @angular/cli


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM