离子与Ubuntu 16.04失败

时间:2016-12-30 13:10:16

标签: ubuntu ionic-framework ubuntu-16.04

我正在尝试在我的ubuntu 16.04上安装离子。

安装完成后,我试着用:

运行它
  

离子启动--v2 myApp标签

我收到以下错误:

******************************************************
 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/tsc-wrapped@* 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 rxjs@* 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 fsevents@1.0.15
-
> node-sass@3.10.1 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

> node-sass@3.10.1 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 rxjs@5.0.0-beta.12 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/core@2.2.1 wants rxjs@5.0.0-beta.12

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

=================更新=================

我跑了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 ...

4 个答案:

答案 0 :(得分:0)

sudo npm install -g cordova

尝试这个

ionic start myApp tabs --v2

如果仍然出现错误

然后请使用ionic info

更新您的问题

答案 1 :(得分:0)

请将您的Cordova CLI安装到版本> = 4.2.0 npm install -g cordova

在Ubuntu中打开终端( Ctrl + Alt + T

检查您的Cordova CLI版本 如果< 4.2.0 做sudo npm install -g cordova

移至离子项目文件夹

cd <your project root folder>

然后做

sudo npm install

sudo npm update

确保一切都是最新的。

然后告诉我错误是否仍然存在。

答案 2 :(得分:0)

仔细观察,我发现在cordova + ionic安装过程中出现了错误。 然后我发现了一个提示 - 问题可能是旧的npm版本。

所以我跑了:

npm -g install npm

和...问题解决了!!

答案 3 :(得分:0)

我得到了同样的错误。我所做的只是

ionic start myapp --v2

在完成错误后,我转到

cd myapp

并运行

npm install

然后它工作正常