刚刚将Angular CLI重新安装到版本7.1.1。运行ng new project-name
时,会发生以下错误:
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! code ERR_STREAM_WRITE_AFTER_END
npm ERR! write after end
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\[username]\AppData\Roaming\npm-cache\_logs\2018-12-04T20_40_23_399Z-debug.log
Package install failed, see above.
更改为项目目录时,无法提供新的Angular应用程序。怎么修这个呢?
您应该查看错误详细信息。
npm WARN deprecated [email protected]: CircularJSON is in maintenance
only, flatted is its successor.
根据它,[email protected]已被弃用。你应该使用flatted。超轻(0.5K)和快速循环JSON解析器,直接来自CircularJSON的创建者。 CircularJSON的未来被称为flatted。
更小,更快,并且能够平均产生减少的输出,平坦的是新的,无膨胀的,ESM和CJS兼容的循环JSON解析器。
使用:npm i flatted
安装它
我已经尝试过接受答案的解决方案但没有任何反应。
经过一番搜索,我找到了一个解决方案。可能它可以帮助别人
跑
npm cache clean --force
步骤1:首先使用此命令npm upgrade -g @angular/cli
升级angular / cli
第2步:重启PC后
第3步:之后创建新项目ng new my-app
它应该工作。