我想创建 Angular 项目,但收到这些警告和错误
npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major version bump
npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated socks@1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated mailcomposer@4.0.1: This project is unmaintained
npm WARN deprecated uws@9.14.0: stop using this version
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated buildmail@4.0.1: This project is unmaintained
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm ERR! write after end
npm ERR! write after end
我尝试通过升级 npm 来修复这些错误,但是在升级 npm 之后,我遇到了同样的问题
最佳答案
我遇到了同样的问题。经过多次尝试和错误,我解决如下。安装 yarn 。然后运行以下代码 ng set --global packageManager=yarn
然后运行 ng new project_name
这样我就解决了问题
如果在任何时候你想恢复到 npm 运行这个: ng config -g cli.packageManager npm
关于javascript - 创建 Angular 项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51020092/