2016-12-30 125 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 

然后正常工作