Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Gulp Basics Welcome to Gulp.js Installing Gulp

patrick tagliaferro
patrick tagliaferro
5,399 Points

npm install -g gulp error

I tried adding gulp global, before adding it to a project, and got a ton of errors. I have node and npm both installed. Here is the terminal read out:

MBP: PT$ which node /usr/local/bin/node MBP:PT$ which npm /usr/local/bin/npm MBP:PT$ npm install -g gulp npm ERR! Darwin 14.3.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "gulp" npm ERR! node v0.12.3 npm ERR! npm v2.9.1 npm ERR! path /usr/local/lib/node_modules/gulp npm ERR! code EACCES npm ERR! errno -13

npm ERR! Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp' npm ERR! at Error (native) npm ERR! { [Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! path: '/usr/local/lib/node_modules/gulp' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! error rolling back Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp' npm ERR! error rolling back at Error (native) npm ERR! error rolling back { [Error: EACCES, rmdir '/usr/local/lib/node_modules/gulp'] npm ERR! error rolling back errno: -13, npm ERR! error rolling back code: 'EACCES', npm ERR! error rolling back path: '/usr/local/lib/node_modules/gulp' }

npm ERR! Please include the following file with any support request:

4 Answers

Alex Robertson-Brown
PLUS
Alex Robertson-Brown
Courses Plus Student 8,956 Points

Have you tried starting with the command with sudo and then entering your password? For most of the commands on this course I had to use sudo so they would install properly. I think this comes down to the setup of your user account.

Like Alex says, try 'sudo npm install -g gulp'. If that does now work you might have to update your npm or node.

patrick tagliaferro
patrick tagliaferro
5,399 Points

That seemed to work. I can now do 'which gulp' and it points to the user bin.

Laetitia tubery
Laetitia tubery
356 Points

Hi,

I've the same error. I tried to to install with sudo but it doesn't work. Here what I get :

npm WARN deprecated lodash@1.0.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0 /usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js /usr/local/lib ā””ā”€ā”€ gulp@3.9.0

Sorry, I'm not confortable with console error. Thanks for your help.

Alex Robertson-Brown
Alex Robertson-Brown
Courses Plus Student 8,956 Points

Is this the entire error message? If it's just a warning, gulp should still function normally. Which one of your functions isn't working properly?