[ERROR] An error occurred while running npm i (exit code 1): code400

Posted adong69

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[ERROR] An error occurred while running npm i (exit code 1): code400相关的知识,希望对你有一定的参考价值。

国庆来了,npm 的命令都不可以用:我新建了一个ionic的项目

ionic start ionc tabs

出现了这个报错:如下:

PS G:lianximyionic02> ionic start myionic03 tabs
√ Creating directory .myionic03 - done!
√ Downloading and extracting tabs starter - done!

? Would you like to integrate your new app with Cordova to target native ios and android? No
√ Personalizing ionic.config.json and package.json - done!

Installing dependencies may take several minutes.

* IONIC DEVAPP *

Speed up development with the Ionic DevApp, our fast, on-device testing mobile app

- Test on iOS and Android without Native SDKs
- LiveReload for instant style and JS updates

?--> Install DevApp: https://bit.ly/ionic-dev-app <--

> npm i
× Running command - failed!
[ERROR] An error occurred while running npm i (exit code 1):


npm ERR! code E400
npm ERR! 400 Bad Request: @angular/[email protected]

npm ERR! A complete log of this run can be found in:
npm ERR! C:Program Files odejs ode_cache\\_logs2018-10-10T00_42_27_177Z-debug.log

 

图片看的应该更清晰一些:

技术分享图片

百度,谷歌搜了很多,没有找到答案,我一直以为是node或者angular的问题,

后来某位大神给我说可能是ionic‘的问题,至此问题才得以解决:

在c盘找到了.npmrc这个文件技术分享图片

把第一行和第4行删除,

在此执行  ionic start ionc tabs

问题完美解决

 










以上是关于[ERROR] An error occurred while running npm i (exit code 1): code400的主要内容,如果未能解决你的问题,请参考以下文章

网页提示“An error occurred”怎么解决啊?

an error occurred怎么解决?

电脑驱动是出现 an unknown error has occurred 则么解决?

SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“(代码

安装软件失败(错误消息:An unknown error has occurred)

An SWT error has occurred