Issue installing ionic on Mac

I’m starting developing my first app, and can’t installa ionic, i get errors

I tried installing node 6.x and 7.x

this is the output i get

$ sudo npm install -g ionic
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated node-uuid@1.3.3: Use uuid module instead
/usr/local/bin/ionic -> /usr/local/lib/node_modules/ionic/bin/ionic

fsevents@1.1.1 install /usr/local/lib/node_modules/ionic/node_modules/fsevents
node install

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
path.js:1142
cwd = process.cwd();
^

Error: EACCES: permission denied, uv_cwd
at Object.resolve (path.js:1142:25)
at startup (bootstrap_node.js:126:32)
at bootstrap_node.js:542:3
/usr/local/lib

[ CUT the three output ]

npm WARN In ionic@2.2.1 replacing bundled version of cross-spawn with cross-spawn@4.0.2
npm WARN In ionic@2.2.1 replacing bundled version of semver with semver@4.2.0
npm WARN In ionic@2.2.1 replacing bundled version of mime-types with mime-types@2.0.14
npm WARN In ionic@2.2.1 replacing bundled version of form-data with form-data@0.2.0
npm WARN In ionic@2.2.1 replacing bundled version of request with request@2.51.0
npm WARN In ionic@2.2.1 replacing bundled version of ionic-app-lib with ionic-app-lib@2.2.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.1 (node_modules/ionic/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.1 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

I reply at my topic, it seems that on newer os x it need to be installed this way

sudo npm install --global –unsafe-perm ionic

I’m just going to keep tilting at this windmill. I see absolutely no benefit in running npm as root. Use nvm instead.

I restarted and installed NVM and node with

nvm install --lts

on NVM page it says


Note: On OS X, if you have/had a “system” node installed and want to install modules globally, keep in mind that:

When using nvm you do not need sudo to globally install a module with npm -g, so instead of doing sudo npm install -g grunt, do instead npm install -g grunt


now to install ionic, i use this command

npm install -g ionic

NOT

nvm install -g ionic

is correct?

Correct. The only time you’ll interact with nvm is installing new versions of node itself and switching between installed versions (IOW, very rarely compared to how much you interact with npm).

1 Like