Ionic@2.0.0 - beta.17 postinstall error

hey today i switch to ionic beta version but when i am trying to install it. This throws an error what i am doing wrong do i need to change my node --version ?

$ npm install -g ionic@beta
C:\Users\nitish.kumar.IDS-LOGIC\AppData\Roaming\npm\ionic -> C:\Users\nitish.kumar.IDS-LOGIC\AppData\Roaming\npm\node_modules\ionic\bin\ionic
> ionic@2.0.0-beta.17 postinstall C:\Users\nitish.kumar.IDS-LOGIC\AppData\Roaming\npm\node_modules\ionic
> node lib/tasks/postinstall
C:\Users\nitish.kumar.IDS-LOGIC\AppData\Roaming\npm\node_modules\ionic\lib\tasks\postinstall.js:9
execSync(cmd, {stdio: [0,1,2]});
^
TypeError: undefined is not a function
    at Object.<anonymous> (C:\Users\nitish.kumar.IDS-LOGIC\AppData\Roaming\npm\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:929:3

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 Windows_NT 6.2.9200
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic@beta"
npm ERR! cwd C:\Users\nitish.kumar.IDS-LOGIC
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

Try this to reset both ionic and cordova and post back if errors:

npm uninstall -g ionic && npm uninstall -g cordova && npm cache clear && npm cache clean && npm i -g cordova ionic@beta

1 Like

@luchillo17

thanks, but i solved it out after updating the node --version

what version did you upgrade to?

Hi,

Iā€™ve got the same postinstall error on my MacBook.

Iā€™ve upgraded node & npm and the ionic beta install worked.

$ node -v
v5.4.1

$ npm -v
3.6.0

Denis

mine works okay with node 0.12.7 and npm 2.11.3

Try this:

  1. Update node
  2. Update npm
  3. Use the command quoted below to wipe out ionic and cordova, clear &&/|| clean cache, and then reinstall, this little command has saved me so many times that i have an alias for it called uionic :stuck_out_tongue:
1 Like

Hi, what are you using to install node on Ubuntu?

Iā€™ve been checking https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server for setting up node. Itā€™s not working for me with the current versions I have but Itā€™s also not trivial to update.

I guess Iā€™ll try the nvm.

I tried all that multiple times and still getting the same errors as the author.

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 ā€˜node lib/tasks/postinstallā€™.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR! npm bugs ionic
npm ERR! Or if that isnā€™t available, you can get their info via:
npm ERR! npm owner ls ionic
npm ERR! There is likely additional logging output above.
npm ERR! Darwin 15.3.0
npm ERR! argv ā€œnodeā€ ā€œ/usr/local/bin/npmā€ ā€œiā€ ā€œ-gā€ "ionic@beta"
npm ERR! node v0.10.42
npm ERR! npm v3.6.0
npm ERR! path npm-debug.log.792550016
npm ERR! code EACCES
npm ERR! errno 3

Is node 0.10.42 not high enough? Also: is it best practise to install with sudo or without?

Ok finally got it installed using node 0.11.13 :slight_smile:

Problem gone after upgrading to:

node: 5.10.0
npm: 2.1.0

was:
node: 2.14.9
npm: 0.12.12

Anyone trying the following sould remember that now it is ionic@latest instead of ionic@beta: