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 Gulp your JavaScript Workflow Minifying JavaScript Files

Ian Mackenzie
Ian Mackenzie
11,062 Points

npm install gulp-uglify --save-dev

Looks like it installs ok but it's not showing in the package.json file?

try to run the {npm init} command one more time to load the dependencies to your package.json. they will list under "dependencies" not "devDependencies". here a screenshot of my package.json http://i.imgur.com/DuYWYsW.png

you can also take a look at this link that explains the difference between the two : http://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies

10 Answers

Ian Mackenzie
Ian Mackenzie
11,062 Points

I ran the install 3 times and it eventually worked. I'm finding NPM is not the most reliable package manager. It's a shame there is not an alternative to install node modules.

Did you do $ npm init before this command?

Ian Mackenzie
Ian Mackenzie
11,062 Points

Yes I used the npm init command at the beginning of the course which created the package.json file.

Unfortunately no idea. It is working for me!

Ian Mackenzie
Ian Mackenzie
11,062 Points

Yes, sometimes it works and sometimes it doesn't. Apparently I'm not the only one as many people have the same problem.

isn't that some weird permission problem? Did not you create the package.json file as a sudo or something? Just guessing. I never experienced this bug.

Ian Mackenzie
Ian Mackenzie
11,062 Points

I may have created it using sudo? Can't remember. Enjoying learning about Gulp though, pretty cool task runner :)

Yes. I disliked Grunt in the past. i use only Gulp these days for a lot of task. I have a quite complex Angular project and i have written the build process in Gulp.

hey bro if you're on linux using sudo npm install gulp-uglify --save-dev if not you're on windows use the npm install gulp-uglify --save-dev

but if you don't create the file package.json you can't follow along , first using the npm init create the package json and after you can install all these , I hope help you with something ..

I have never experienced problems. Could you pleaese answer my question?

Did you do $ npm init before run $ npm install ... ?