命令行,進入項目路徑后,運行
ionic start myApp --v2
命令執行后,報如下錯誤
Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined
從githut查到是因為node和npm版本低了,解決方法如下
https://github.com/driftyco/ionic-cli/issues/1089
1.升級node
win下直接官網下載最新安裝包 https://nodejs.org/en/
OS X 下運行命令
npm install -g n
2.升級npm
upgrade npm
3. 注冊表重新注冊 set new registry
npm set registry http://registry.npmjs.org
4. 結果按照上面的步驟執行完之后,
cordova版本也低了,只好繼續升級cordova
npm install -g cordova
但是cordova升級報錯
從github上面沒找到答案,自己試着退出項目路徑重新試了一下,結果就成功了……,所以升級和安裝什么的,還是得在node的安裝路徑。