2016-12-30 141 views
0

我想在我的Ubuntu 16.04上安裝離子。離子與Ubuntu 16.04失敗

有它安裝後,我試圖與運行:

ionic start --v2 myApp tabs

我得到以下錯誤:

****************************************************** 
Dependency warning - for the CLI to run correctly,  
it is highly recommended to install/upgrade the following:  

Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova` 

****************************************************** 
Creating Ionic app in folder /home/guy/myApp based on tabs project 
Downloading: https://github.com/driftyco/ionic2-app-base/archive/master.zip 
[=============================] 100% 0.0s 
Downloading: https://github.com/driftyco/ionic2-starter-tabs/archive/master.zip 
[=============================] 100% 0.0s 
Installing npm packages... 
npm WARN peerDependencies The peer dependency @angular/[email protected]* included from @ionic/app-scripts will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN peerDependencies The peer dependency [email protected]* included from @ionic/app-scripts will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm WARN optional dep failed, continuing [email protected] 
- 
> [email protected] install /home/guy/myApp/node_modules/@ionic/app-scripts/node_modules/node-sass 
> node scripts/install.js 

Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.10.1/linux-x64-46_binding.node 
Binary downloaded and installed at /home/guy/myApp/node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/linux-x64-46/binding.node 

> [email protected] postinstall /home/guy/myApp/node_modules/@ionic/app-scripts/node_modules/node-sass 
> node scripts/build.js 

"/home/guy/myApp/node_modules/@ionic/app-scripts/node_modules/node-sass/vendor/linux-x64-46/binding.node" exists. 
testing binary. 
Binary is fine; exiting. 
npm ERR! Linux 4.4.0-57-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" 
npm ERR! node v4.7.0 
npm ERR! npm v2.15.11 
npm ERR! code EPEERINVALID 

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements! 
npm ERR! peerinvalid Peer @angular/[email protected] wants [email protected] 

npm ERR! Please include the following file with any support request: 
npm ERR!  /home/guy/myApp/npm-debug.log 
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 

============== === UPDATE =================

我跑ionic info並得到了這一點:

****************************************************** 
Dependency warning - for the CLI to run correctly,  
it is highly recommended to install/upgrade the following:  

Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova` 

****************************************************** 

Your system information: 

Cordova CLI: You have been opted out of telemetry. To change this, run: cordova telemetry on. 
6.4.0 

Ionic CLI Version: 2.1.18 
Ionic App Lib Version: 2.1.7 
ios-deploy version: Not installed 
ios-sim version: Not installed 
OS: Linux 4.4 
Node Version: v4.7.0 
Xcode version: Not installed 


****************************************************** 
Dependency warning - for the CLI to run correctly,  
it is highly recommended to install/upgrade the following:  

Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova` 

****************************************************** 

不過,我已經運行sudo npm install -g cordova幾次......

回答

0

更深入地看,在Cordova +離子的安裝過程中發現了一個錯誤。 然後我發現一個提示 - 問題可能是一箇舊的npm版本。

所以我跑:

npm -g install npm 

和...問題解決了!

0

sudo npm install -g cordova

試試這個

ionic start myApp tabs --v2 

如果仍然收到錯誤

請更新您的問題與ionic info

+0

不工作 - 準確得到相同的結果。 – guyaloni

+0

檢查我的更新回答 –

+0

我仍然收到一個錯誤 - '錯誤與啓動undefined 錯誤初始化應用程序:產生的命令有錯誤:npminstall'我會按照你的要求更新我的問題。謝謝! – guyaloni

0

請安裝您的Cordova CLI版本> = 4.2.0 npm install -g cordova

打開在Ubuntu終端(按Ctrl + Alt + T

檢查科爾多瓦的版本CLI 如果< 4.2.0 做sudo npm install -g cordova

移動到您的離子項目文件夾

cd <your project root folder>

然後做

sudo npm install

sudo npm update

,以確保一切是最新的。

然後告訴我,如果錯誤仍然存​​在或不。

+0

當我嘗試'sudo npm install'時,出現錯誤'npm ERR!安裝無法讀取依賴關係.... npm ERR! package.json ENOENT:沒有這樣的文件或目錄,打開'/ home/guy/package.json' – guyaloni

+0

嘿@guyaloni我認爲你沒有改變你的目錄到項目文件夾。項目文件夾是在執行'ionic start projectname --v2 tabs'時創建的文件夾。檢查更新的說明並查看是否有幫助。 –

+0

我有科爾多瓦版本6.4.0。看起來你問我鎖定抽屜並將鑰匙放在裏面......如何在創建之前移動到項目目錄? – guyaloni

0

我得到相同的錯誤。我要做的就是

ionic start myapp --v2 

與錯誤完成後,我去

cd myapp 

和運行

npm install 

然後正常工作