Skip to content

Instantly share code, notes, and snippets.

@rangedsp
Created April 8, 2016 00:35
Show Gist options
  • Save rangedsp/7eceb320fea00b344dbdd17cd154cdef to your computer and use it in GitHub Desktop.
Save rangedsp/7eceb320fea00b344dbdd17cd154cdef to your computer and use it in GitHub Desktop.
Global install fails in Bash on Ubuntu on Windows (fresh install)
root@localhost:~# npm install -g gulp
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
/root/.npm-global/lib
└── (empty)
npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "gulp"
npm ERR! node v5.10.1
npm ERR! npm v3.8.3
npm ERR! path /root/.npm-global/lib/node_modules/.staging/ansi-regex-b1c1d3b1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rename
npm ERR! Error: EACCES: permission denied, rename '/root/.npm-global/lib/node_modules/.staging/ansi-regex-b1c1d3b1' -> '/root/.npm-global/lib/node_modules/gulp/node_modules/ansi-regex'
npm ERR! at destStatted (/usr/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR!
npm ERR! Error: EACCES: permission denied, rename '/root/.npm-global/lib/node_modules/.staging/ansi-regex-b1c1d3b1' -> '/root/.npm-global/lib/node_modules/gulp/node_modules/ansi-regex'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, rename '/root/.npm-global/lib/node_modules/.staging/ansi-regex-b1c1d3b1' -> '/root/.npm-global/lib/node_modules/gulp/node_modules/ansi-regex'] parent: 'gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log
npm ERR! code 1
@karlprieb
Copy link

I had the same error. You know how to fix this?

@Sneagan
Copy link

Sneagan commented Apr 9, 2016

Same issue here. Here's what I've tried:

  • Run as Admin
  • sudo
  • Reinstall Node
  • Remove and reinstall all modules
  • Reboot

@dimitrovs
Copy link

Still have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment