Ubuntu 16.04 失败的离子

Ionic with Ubuntu 16.04 failure

我正在尝试在我的 ubuntu 16.04.

上安装 ionic

安装后,我尝试运行它:

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/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好几次了...

给予sudo npm install -g cordova

试试这个

ionic start myApp tabs --v2

如果仍然出现错误

那么请用 ionic info

更新您的问题

请将您的 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

确保一切都是最新的。

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

再往下看,发现在安装cordova + ionic的时候报错了。 然后我发现了一个提示 - 问题可能是旧的 npm 版本。

所以我运行:

npm -g install npm

并且...问题已解决!!

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

ionic start myapp --v2

完成错误后,我转到

cd myapp

和运行

npm install

然后它工作正常