[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/common@5.2.11

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

问题完美解决

原文地址:https://www.cnblogs.com/adong69/p/9765489.html