[英]Angular project creation failed because of deprecated circular-json
I used following command to create new angular project 我用以下命令创建了新的角度项目
ng new hello-world
It failed showing 它失败了
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! Unexpected end of JSON input while parsing near '...rocess":"~0.7.0"},"_h'
Then I installed flatted using... 然后我安装平板使用...
npm i flatted
But the error still occurs. 但错误仍然存在。 How to use flatted instead of deprecated library circular-json?
如何使用flatted而不是deprecated library circular-json?
Run following commands that will clean NPM cache 运行以下命令清理NPM缓存
npm cache clean --force
npm cache clean --force
after this run following command 在此运行以下命令之后
npm install -g @angular/cli@latest
npm install -g @ angular / cli @ latest
then you can create angular project. 然后你可以创建角项目。
If it doesn't work, even after clearing the cache, which happened in my case: 如果它不起作用,即使清除了缓存,这在我的情况下发生:
Make sure you try the ng new create-app
command using Powershell in administrator mode. 确保在管理员模式下使用Powershell尝试
ng new create-app
命令。
This worked for me. 这对我有用。
I had the same problem. 我有同样的问题。 None of the above mentioned answers worked for me.
上述答案都不适合我。
So I removed the content of .npmrc
, ran the generate command and it worked. 所以我删除了
.npmrc
的内容,运行了generate命令并且它工作正常。
After that, you can restore the content of your .npmrc
if needed. 之后,您可以根据需要恢复
.npmrc
的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.