1

My questions are

Whenever i tried to install nodejs using command line

# apt-get install nodejs

it installs the older version (in my case it installed 0.10.x),where as the current version till date is 4.1.2 .Why this command do not gives me a latest version.Is there any other way to install the latest version though i tried using nvm.

I checked the installed versions

node -v && npm -v && cordova -v
v0.12.7
3.3.5
5.3.3

It seems node v0.12.7 is installed in my system but when i am trying to install ionic

npm install -g cordova ionic

i am finding the error

    npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} 

(current: {"node":"0.12.7","npm":"3.3.5"})

even my current version is greater then the required version why its throwing me an error,do it strict with the specific version.

anujayk
  • 544
  • 7
  • 31

2 Answers2

3

Do not make use of apt get, there is no harm in installing node using platform specific tools but it is better to make use of nvm which is consistent among all platforms.

Make sure to uninstall the current version of node this post can help.

Next follow these steps.

  1. Go to https://github.com/creationix/nvm
  2. Use curl to install nvm curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.28.0/install.sh | bash
  3. Source your profile source ~/.profile
  4. Install NodeJs nvm install v4.1.0
  5. Alias installed version to default nvm alias default v4.1.0
  6. Set aliased version as the final node version nvm use default
  7. node -v will result in v4.1.0

In your case you may have to install version 0.10.x, you can also do nvm ls-remote to list available versions for download.

Community
  • 1
  • 1
Aman Virk
  • 3,909
  • 8
  • 40
  • 51
  • Upgrading node version works fine for me,but still why i am getting a warning while installing ionic,why i need v0.10.x even when i am having version greater than that,won't it support the older versions dependents? – anujayk Oct 06 '15 at 06:29
  • No this is not how npm works. I module defines it's dependencies on certain versions on node and npm will throw warning no matter whether you can the greatest version or not. It is quite possible that new version may have removed something that package is dependent upon. So it's npm responsibility to warn you about same – Aman Virk Oct 07 '15 at 02:59
-1

it's warning not an error so don't worry and if you want to install ionic platform then use bellow commands and still you face any problem then message me.

npm install -g ionic
  • why i am getting a warning while installing ionic,why i need v0.10.x even when i am having version greater than that(4.1.0),won't it support the older versions dependents? – anujayk Oct 06 '15 at 06:31