ionic2 installation on ubuntu 14.04

Hi everybody!
I have trouble to install Ionic 2@beta.
help me

Same here on Ubuntu 15.10

$ sudo npm install -g ionic@beta
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic

> ionic@2.0.0-beta.17 postinstall /usr/local/lib/node_modules/ionic
> node lib/tasks/postinstall


/usr/local/lib/node_modules/ionic/lib/tasks/postinstall.js:9
execSync(cmd, {stdio: [0,1,2]});
^
TypeError: undefined is not a function
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/lib/tasks/postinstall.js:9:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
 
npm ERR! ionic@2.0.0-beta.17 postinstall: `node lib/tasks/postinstall`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the ionic@2.0.0-beta.17 postinstall script.
npm ERR! This is most likely a problem with the ionic package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node lib/tasks/postinstall
npm ERR! You can get their info via:
npm ERR!     npm owner ls ionic
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.2.0-27-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ionic@beta"
npm ERR! cwd /home/vukasin/Development/workspace/nortal/mobile-apps/GCloudMobileIonicV2/ionic2-starter-sidemenu
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/vukasin/Development/workspace/nortal/mobile-apps/GCloudMobileIonicV2/ionic2-starter-sidemenu/npm-debug.log
npm ERR! not ok code 0

OK - let me reply on my issue :slightly_smiling:

Conclusion

Issue was in NodeJS version - ubuntu pack older version of nodejs:

 $ apt-cache show nodejs
 Version: 0.10.25~dfsg2-2ubuntu1

Resolution:

Uninstall node from repository:

$ apt-get remove nodejs

Install NVM - nodejs verions manager

$ sudo apt-get install build-essential libssl-dev
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash

Note

Here you’ll need to restart your bash session in order to get nvm loaded - available on path (close / open terminal).

$ nvm install 5.0
$ nvm use 5.0

$ node --version
  v5.0.0
$ npm --version
  3.3.6

Install Ionic 2 beta

$ npm install -g ionic@beta
$ ionic --version
  2.0.0-beta.17

Yahoooooooooo - it works !!! :slightly_smiling:

1 Like