Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion Creating Your Own Arbitrary Tasks

Should uglify also be in the hidden .bin directory?

I am working locally in vscode and mocha is showing up in the .bin directory, but i don't see anything for uglify and i believe for that reason i keep getting an error message as shown below.

bash: node_modules/.bin/uglifyjs: No such file or directory

How can I fix this?

LESSON: https://teamtreehouse.com/library/creating-your-own-arbitrary-tasks

1 Answer

Bader Alsabah
Bader Alsabah
4,738 Points

I believe you just need to run the install npm command to have uglifyjs. Make sure in the package.json file the following development dependencies are shown

 "devDependencies": {
    "mocha": "^2.2.5",
    "uglify-js": "^2.4.23"
  }

If the above dependencies are in your package.json file, then all you need to do is type the following command and that will install both mocha and uglify into the node modules bin.

npm install