1. 程式人生 > >[ERROR] An error occurred while running npm i (exit code 1): code400

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

depend img ova seve http done nbsp ike ack

國慶來了,npm 的命令都不可以用:我新建了一個ionic的項目

ionic start ionc tabs

出現了這個報錯:如下:

PS G:\lianxi\myionic02> 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\nodejs\node_cache\_logs\2018-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