Installing IONIC not successful - Solved

Please advice am getting below error while installing ionic. Appreciate your help.

Babu$ sudo npm install -g ionic

spawn-sync@1.0.13 postinstall /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall

sh: node: command not found
npm WARN engine cordova-js@4.0.0: wanted: {“node”:“~0.10.x”} (current: {“node”:“4.2.1”,“npm”:“2.14.7”})
npm WARN engine xmlbuilder@2.2.1: wanted: {“node”:“0.8.x || 0.10.x”} (current: {“node”:“4.2.1”,“npm”:“2.14.7”})

node-sass@3.3.3 install /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass
node scripts/install.js

sh: node: command not found
npm ERR! Darwin 14.5.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” “ionic”
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! spawn-sync@1.0.13 postinstall: node postinstall
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the spawn-sync@1.0.13 postinstall script ‘node postinstall’.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/Babu/src/node/npm-debug.log

Look here:

http://askubuntu.com/a/311332

You probably didn’t “source” the nvm.sh script in your .bashrc script.

And by the way, I think when you use “nvm” then you should NOT use sudo. Using sudo all the time, even when it’s not necessary, will only cause you a lot of headache down the line.

Thanks for the advise leob… i have narrowed down to below error. Trying to check if anyone have any suggestions…

Arvinds-MacBook-Pro:scripts Babu$ sudo npm install -g ionic
/usr/local/bin/ionic → /usr/local/lib/node_modules/ionic/bin/ionic

node-sass@3.3.3 install /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass
node scripts/install.js

sh: node: command not found
npm WARN install:node-sass@3.3.3 node-sass@3.3.3 install: node scripts/install.js
npm WARN install:node-sass@3.3.3 spawn ENOENT

spawn-sync@1.0.13 postinstall /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall

sh: node: command not found
npm WARN install:spawn-sync@1.0.13 spawn-sync@1.0.13 postinstall: node postinstall
npm WARN install:spawn-sync@1.0.13 spawn ENOENT
/usr/local/lib
└── (empty)

npm ERR! code 1

Taking a stab in the dark but the error says it cannot find node. Have you installed node yet?

https://nodejs.org/en/download/

Yes i did…

Arvinds-MacBook-Pro:~ Babu$ node -v
v5.0.0

I found out last night Ionic is not compatible with Node 5.0.0. Not sure if this is 100% of your issue as I wasn’t getting any errors when I figured this was my issues. I suggest you downgrade and try again.

Instructions as per http://stackoverflow.com/a/23569481/158126

$ npm install -g n 
$ n 4.2.1

I am using node 4.2.1 but am getting the following error when I try to install Ionic

gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–verbose” “–libsass_ext=” “–libsass_cflags=” “–libsass_ldflags=” “–libsass_library=“
gyp ERR! cwd /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
npm WARN engine cordova-js@4.0.0: wanted: {“node”:”~0.10.x”} (current: {“node”:“4.2.1”,“npm”:“2.14.7”})
npm WARN engine xmlbuilder@2.2.1: wanted: {“node”:“0.8.x || 0.10.x”} (current: {“node”:“4.2.1”,“npm”:“2.14.7”})
npm ERR! Darwin 10.8.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “install” “-g” "ionic"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.3.3 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.3.3 postinstall script ‘node scripts/build.js’.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

HELLO EVERYONE
While i am installing ionic framework in my system and running the command ionic start myApp tabs it is showing the following error and saying missing xml helpers.It is saying cannot find module xml helpers.


Please help me in this issue…

Hi did you find the solution to this error been having the same error for two days now…!!!
Thanks

Hi @Adams254 i am also stuck on the same problem. Did you find a solution?

Hi @cabbabu, I am stuck with the same problem, did you find the solution for it?

I was using ubuntu desktop 14.04 so I had installed the android SDK in a different path from the path declared in the $PATH variable of the system so i just copied the files into the same path and run it again and it worked…!!