# Issue getting npm install -g ember-cli to work - Node issue?

**URL:** https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775
**Category:** Ember CLI
**Created:** [April 11, 2015, 5:32am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775 "2015-04-11T05:32:48Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![john1214](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@john1214](https://discuss.emberjs.com/u/john1214)
#### Post date: [April 11, 2015, 5:32am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/1 "2015-04-11T05:32:48Z")

</div>

Hey guys,

I hope this isn’t too basic or silly of a question to ask - really looking forward to working with Ember Cli and not sure what’s going on. Im a bit new to node and think there’s something up with my NPM - any ideas? Thanks!

```
$npm install -g ember-cli
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "ember-cli"
npm ERR! node v0.10.35  
npm ERR! npm v2.8.0
npm ERR! path /usr/local/lib/node_modules/ember-cli/.editorconfig    
npm ERR! code EACCES
npm ERR! errno 3

npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/ember- cli/.editorconfig'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/ember-cli/.editorconfig']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/ember-cli/.editorconfig' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/ember-cli/.editorconfig'
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/local/lib/node_modules/ember-cli/.editorconfig']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/ember-cli/.editorconfig' }

npm ERR! Please include the following file with any support request:
npm ERR! /Users/apprentice/Desktop/npm-debug.log

```

---

<div class="post-metadata">

### Author: ![guigouz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/guigouz/32/9122_2.png) [@guigouz](https://discuss.emberjs.com/u/guigouz)
#### Post date: [April 11, 2015, 6:31am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/2 "2015-04-11T06:31:29Z")

</div>

What platform are you running on? Windows, MacOS, Linux? I most cases the `-g` option (for global) requires to run the command with admin rights. So for Linux/MacOS you should run something like `sudo npm install -g ember-cli`. For Windows, make sure your terminal has admin rights too (should be the case by default).

---

<div class="post-metadata">

### Author: ![eccegordo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/eccegordo/32/14927_2.png) [@eccegordo](https://discuss.emberjs.com/u/eccegordo)
#### Post date: [April 11, 2015, 6:33am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/3 "2015-04-11T06:33:10Z")

</div>

It looks as though there there is a likely a permissions issue and that the node environment environment you have configured is only working with sudo access.

For a lot of subtle reasons you really want to avoid having to use sudo when installing node and node modules.

In general, I would recommend removing node completely from your computer (there are various instructions on how to do this if you google around) and then reinstall node and npm cleanly using only local user permissions. It will make things less complicated and less error prone in the long run.

Once you have removed node…

NVM (Node Version Manager) is a clean way to manage and install node on your Mac and you can easily install multiple versions if needed.

See more here.

> **[GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to...](https://github.com/nvm-sh/nvm)**
>
> Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions - GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active nod...

The trick is to never use sudo when running node and npm commands, that way you can be assured everything will just work with your regular user permissions and everything will be installed in your regular home directory.

The reason I suggest uninstalling node first is that you will want to avoid conflicts with multiple versions of node in your $PATH and make sure you are always using the version installed with regular user permissions.

I wrote a general write up here if you are new to node and ember cli [Introduction to Ember CLI, Node and NPM · GitHub](https://gist.github.com/eccegordo/ad908734e7798bf6fa86)

Hope it helps

---

<div class="post-metadata">

### Author: ![eccegordo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/eccegordo/32/14927_2.png) [@eccegordo](https://discuss.emberjs.com/u/eccegordo)
#### Post date: [April 11, 2015, 6:36am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/4 "2015-04-11T06:36:34Z")

</div>

@guigouz He is on Mac OS X because it says

> Darwin 14.1.0

Which is the open source port of BSD that OS X is based on.

> **[Darwin (operating system)](https://en.wikipedia.org/wiki/Darwin_(operating_system))**
>
> Darwin is the core Unix operating system of macOS (previously OS X and Mac OS X), iOS, watchOS, tvOS, iPadOS, visionOS, and bridgeOS. It previously existed as an independent open-source operating system, first released by Apple Inc. in 2000. It is composed of code derived from NeXTSTEP, BSD, Mach, and other free software projects' code, as well as code developed by Apple.
> Darwin is mostly POSIX-compatible, but has never, by itself, been certified as compatible with any version of POSIX. Starti...

---

<div class="post-metadata">

### Author: ![john1214](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@john1214](https://discuss.emberjs.com/u/john1214)
#### Post date: [April 11, 2015, 7:03am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/5 "2015-04-11T07:03:41Z")

</div>

Thanks guys! I’ll remove node and reinstall everything - see how that works.

---

<div class="post-metadata">

### Author: ![john1214](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@john1214](https://discuss.emberjs.com/u/john1214)
#### Post date: [April 16, 2015, 12:14am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/6 "2015-04-16T00:14:10Z")

</div>

Hey guys - I seem to still be running into some issues getting ember-cli to work. I followed the steps to uninstall node and npm and reinstall. It

```
$ ember 
 bash: ember: command not found

```

Here’s what I’m getting when I try to install ember

```
$ npm install -g ember-cli

```

Here’s what I’m getting

> ws@0.5.0 install /Users/apprentice/.node/lib/node\_modules/ember-cli/node\_modules/testem/node\_modules/socket.io/node\_modules/engine.io/node\_modules/ws (node-gyp rebuild 2\> builderror.log) || (exit 0)

> CXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK\_MODULE(target) Release/bufferutil.node SOLINK\_MODULE(target) Release/bufferutil.node: Finished CXX(target) Release/obj.target/validation/src/validation.o SOLINK\_MODULE(target) Release/validation.node SOLINK\_MODULE(target) Release/validation.node: Finished

> ws@0.4.31 install /Users/apprentice/.node/lib/node\_modules/ember-cli/node\_modules/testem/node\_modules/socket.io/node\_modules/socket.io-client/node\_modules/engine.io-client/node\_modules/ws (node-gyp rebuild 2\> builderror.log) || (exit 0)

> CXX(target) Release/obj.target/bufferutil/src/bufferutil.o /Users/apprentice/.node/bin/ember → /Users/apprentice/.node/lib/node\_modules/ember-cli/bin/ember ember-cli@0.2.3 /Users/apprentice/.node/lib/node\_modules/ember-cli ├── broccoli-unwatched-tree@0.1.1 ├── pleasant-progress@1.0.2 ├── is-git-url@0.2.0 ├── abbrev@1.0.5 ├── ember-cli-copy-dereference@1.0.0 ├── broccoli-writer@0.1.1 ├── promise-map-series@0.2.1 ├── js-string-escape@1.0.0 ├── walk-sync@0.1.3 ├── broccoli-merge-trees@0.2.1 ├── exit@0.1.2 ├── temp@0.8.1 (rimraf@2.2.8) ├── semver@4.3.3 ├── strip-ansi@2.0.1 (ansi-regex@1.1.1) ├── rsvp@3.0.18 ├── debug@2.1.3 (ms@0.7.0) ├── broccoli-sane-watcher@1.0.2 (broccoli-slow-trees@1.1.0) ├── broccoli-filter@0.1.12 (mkdirp@0.3.5) ├── symlink-or-copy@1.0.1 (copy-dereference@1.0.0) ├── http-proxy@1.10.1 (requires-port@0.0.0, eventemitter3@0.1.6) ├── rimraf@2.3.2 (glob@4.5.3) ├── broccoli-funnel@0.2.2 (mkdirp@0.5.0) ├── broccoli-kitchen-sink-helpers@0.2.6 (mkdirp@0.3.5, glob@4.0.4) ├── sane@1.0.3 (watch@0.10.0, fb-watchman@0.0.0, minimatch@0.2.14, walker@1.0.6) ├── markdown-it@4.0.3 (linkify-it@1.0.0, uc.micro@1.0.0, mdurl@1.0.0, entities@1.1.1, argparse@1.0.2) ├── yam@0.0.18 (lodash.merge@3.1.0) ├── ember-router-generator@0.3.3 (recast@0.9.18) ├── broccoli-es3-safe-recast@2.0.0 (es3-safe-recast@2.0.1) ├── broccoli-es6modules@0.5.1 (broccoli-caching-writer@0.5.3, mkdirp@0.5.0, esperanto@0.6.28) ├── core-object@0.0.2 (lodash-node@2.4.1) ├── broccoli-caching-writer@0.5.5 (core-object@0.0.3, lodash-node@2.4.1) ├── broccoli-sourcemap-concat@0.4.3 (broccoli-caching-writer@0.5.3, mkdirp@0.5.0, combined-stream@0.0.7, fast-sourcemap-concat@0.2.4, lodash-node@2.4.1) ├── markdown-it-terminal@0.0.2 (ansi-styles@2.0.1, cli-table@0.3.1, cardinal@0.5.0, lodash-node@3.6.0) └── testem@0.8.0-0 (growl@1.8.1, styled\_string@0.0.1, did\_it\_work@0.0.6, consolidate@0.11.0, charm@1.0.0, xmldom@0.1.19, async@0.9.0, mustache@1.2.0, cross-spawn@0.2.9, commander@2.8.0, glob@4.5.3, colors@1.0.3, mkdirp@0.5.0, backbone@1.1.2, fileset@0.1.5, fireworm@0.6.6, npmlog@1.2.0, js-yaml@3.2.7, tap@0.6.0, [socket.io](http://socket.io)@1.3.5)

---

<div class="post-metadata">

### Author: ![eccegordo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/eccegordo/32/14927_2.png) [@eccegordo](https://discuss.emberjs.com/u/eccegordo)
#### Post date: [April 16, 2015, 7:36am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/7 "2015-04-16T07:36:59Z")

</div>

Did you reinstall with nvm?

what is returned when you type?

```
node --version 

```

what is returned when you type?

```
npm -version

```

what is returned when you type?

```
which ember

```

what is returned when you type?

```
which node

```

---

<div class="post-metadata">

### Author: ![john1214](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@john1214](https://discuss.emberjs.com/u/john1214)
#### Post date: [April 17, 2015, 12:40am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/8 "2015-04-17T00:40:59Z")

</div>

Thanks for the help - here’s what I get.

node --version =\> v0.12.2

npm -version =\> 2.7.4

which ember =\> (I get nothing)

which node =\> /usr/local/bin/node

nvm =\> Node Version Manager

---

<div class="post-metadata">

### Author: ![eccegordo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/eccegordo/32/14927_2.png) [@eccegordo](https://discuss.emberjs.com/u/eccegordo)
#### Post date: [April 17, 2015, 4:32am UTC](https://discuss.emberjs.com/t/issue-getting-npm-install-g-ember-cli-to-work-node-issue/7775/9 "2015-04-17T04:32:11Z")

</div>

It appears that perhaps nvm and node weren’t installed correctly.

remove the node in

```
/usr/local/bin/node

```

And then follow the NVM install instructions here: [https://github.com/creationix/nvm/blob/master/README.markdown](https://github.com/creationix/nvm/blob/master/README.markdown)

e.g.

```
curl https://raw.githubusercontent.com/creationix/nvm/v0.24.1/install.sh | bash

```

If that command runs successfully you should have NVM installed and then you can use NVM to download and install node itself. Here is the NVM command to install a specific version of node:

```
nvm install 0.12

```

Once that is done when you run the command

```
which node

```

If should return something like this (depending on which version of node gets installed).

```
/Users/apprentice/.nvm/versions/node/v0.12.2/bin/node

```
