简体   繁体   English

在Ubuntu 14.04中进行离子安装失败

[英]Ionic installation in ubuntu 14.04 failed

I have this issue when trying to install Ionic. 尝试安装Ionic时出现此问题。

mypc@mypc-HP-ProBook-470-G2:~$ sudo npm install -g ionic
npm http GET https://registry.npmjs.org/ionic
npm http 200 https://registry.npmjs.org/ionic
npm http GET https://registry.npmjs.org/ionic/-/ionic-1.7.14.tgz
npm http 200 https://registry.npmjs.org/ionic/-/ionic-1.7.14.tgz
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic
npm WARN unmet dependency /usr/local/lib/node_modules/ionic/node_modules/connect/node_modules/finalhandler requires debug@'1.0.4' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /usr/local/lib/node_modules/ionic/node_modules/request/node_modules/form-data requires combined-stream@'~0.0.4' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
ionic@1.7.14 /usr/local/lib/node_modules/ionic

Can someone help me to solve it, please ? 有人可以帮我解决吗?

Thanks. 谢谢。

To answer your question, it;s the npm and nodejs version which is wrong. 为了回答您的问题,它是npmnodejs版本,这是错误的。 ( At least it was in my case ) 至少在我的情况下

I believe this has to do with the later added feature of scoped packages . 我认为这与后来添加的作用域包功能有关。


Update to a later version of node, I am not sure, if you are on ubuntu specifically or not, but for this purpose I was using ubuntu 14.x. 我不确定是否更新到更高版本的node,是否专门使用ubuntu,但是出于这个目的,我使用的是ubuntu14.x。

Remove all nodejs installs you might currently have : 删除您当前可能具有的所有nodejs安装:

sudo apt-get remove --purge nodejs

then you want to install node through the NVM package 那么您想通过NVM软件包安装节点

You can search for a version you want via : 您可以通过以下方式搜索所需的版本:

nvm ls-remote

For the ionic install I updated to : v0.12.10 对于离子安装,我更新为:v0.12.10

nvm install 0.12.10

After this installs (It's also going to install/update npm for you) 安装完成后(还将为您安装/更新npm)

You should see your latest version : 您应该会看到最新版本:

node -v

Should display : v.0.12.10 in this case. 在这种情况下,应显示: v.0.12.10

You may then continue to install the ionic framework as instructed . 然后,您可以按照说明继续安装ionic框架。

npm install -g ionic

Note: NVM also allows you to have concurrent installs of different node versions. 注意: NVM还允许您同时安装不同节点版本。 Very handy for some legacy apps // services. 对于某些旧版应用程序//服务非常方便。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM