Home Unable to install Ionic with npm? (Mac OSX El Capitan 10.11.2)
Reply: 2

Unable to install Ionic with npm? (Mac OSX El Capitan 10.11.2)

gautham ganesh elango
1#
gautham ganesh elango Published in 2016-05-01 10:03:53Z

I am trying to install Ionic using npm, on my mac, running OSX El Capitan 10.11.2.

sudo npm install -g cordova ionic

Cordova is already installed, and I definitely entered my password correctly. Here are the error messages and logs:

Last login: Sun May  1 18:41:17 on ttys001
egaumbp:~ gg$ sudo npm install -g cordova ionic
Password:
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic

> node-sass@3.4.2 install /usr/local/lib/node_modules/ionic/node_modules/node-sass
> node scripts/install.js

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:424
var path = (i >= 0) ? arguments[i] : process.cwd();
                                             ^

Error: EACCES: permission denied, uv_cwd
at Error (native)
at Object.posix.resolve (path.js:424:50)
at startup (node.js:96:32)
at node.js:968:3
npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic"
npm ERR! node v4.4.1
npm ERR! npm  v2.14.20
npm ERR! code ELIFECYCLE

npm ERR! node-sass@3.4.2 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.4.2 install script 'node scripts/install.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/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/gg/npm-debug.log
egaumbp:~ gg$ 

Is there a solution?

gautham ganesh elango
2#
gautham ganesh elango Reply to 2016-06-13 11:48:30Z

If you are having issues install Ionic, you might wanna check an article I wrote on installing it: https://medium.com/@gautham.gg/how-to-install-ionic-on-mac-without-issues-3efe92a0da93#.yh5zsay13 Here is a summary of the article:

Prerequisite: npm must be installed. You can check this by entering this command: 'npm -v'. This should give you the version number. If not please install them.

Now lets fix the issue.

First launch this command:

sudo npm install --global --unsafe-perm quickscrape

Then, launch this command:

sudo npm install -g cordova ionic --unsafe-perm quickscrape

Now, run this command:

sudo npm install -g ionic --unsafe-perm node-sass

Once I did this, Ionic worked beautifully. This was done on a MacBook Pro (Retina, 13-inch, Late 2012), running OSX El Capitan 10.11.2. I'm not sure if Windows users have any issues with this, but I believe that you should remove the 'sudo' if you are doing this on windows.

Now that you have followed my steps, both Ionic and Cordova should be installed, and working. Start by creating a blank Ionic project:

ionic start myApp blank

schellmax
3#
schellmax Reply to 2016-09-01 14:27:39Z

no idea what 'quickscrape' (in the accepted answer) is, but the solution as given here was easier and worked for me:

sudo chown -R $USER /usr/local/

and then never use sudo again with npm.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.334232 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO