简体   繁体   English

由于已弃用的circular-json,角度项目创建失败

[英]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.

相关问题 JSON循环引用角度错误 - JSON circular reference Angular Error 使用jQuery将HTML文本刮到JSON中,但由于循环引用而无法进行字符串化 - Scraping HTML text into JSON with jQuery, but cannot stringify because of circular reference 通过ng new命令创建Angular新项目正在使用旧版本创建package.json - Angular new project creation through ng new command is creating package.json with old versions 由于 json 的循环结构,我不断获得状态 500 - I keep getting status 500 because of Circular structure of json 由于循环 JSON 错误,Azure 持久功能无法返回 Object - Azure Durable Functions cannot return an Object because of circular JSON error Angular 6-由于NGRX,生产构建失败 - Angular 6 - production build failed because of NGRX 角度构建失败,因为它包含另一个角度项目中的组件 - Angular build fails because it includes components from another angular project 使用Angular.JS将JSON值绑定到Syncfusion圆规 - Using Angular.JS to bind a JSON value to a Syncfusion Circular gauge Angular Universal ERROR TypeError:将循环结构转换为 JSON - Angular Universal ERROR TypeError: Converting circular structure to JSON UnhandledPromiseRejectionWarning: TypeError: 使用 Jest + Angular 将循环结构转换为 JSON - UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON with Jest + Angular
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM