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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![James McDonough](https://secure.gravatar.com/avatar/b439519edad25662111b5e9e460c9316?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
James McDonough
15,618 PointsSeveral commands don't work, uglify can't be found, workspaces keeps "losing connection"
This and the previous node.js and npm courses are really severely out of date and I've been jumping through so many extra hoops just to try to make this stuff work so I can understand it. So far I've done neither.
My current problem is about the middle of the video, when you're supposed to run "npm run uglify"
dice_simulator_2015@1.0.0 uglify /home/treehouse/workspace
uglifyjs src/models/* src/frontend.js -m -c -o build/app.js
sh: uglifyjs: command not found
npm ERR! Linux 4.4.68-1.el7.elrepo.x86_64
npm ERR! argv "/usr/local/nodejs-binary-6.11.1/bin/node" "/usr/local/nod
ejs-binary/bin/npm" "run" "uglify"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! dice_simulator_2015@1.0.0 uglify: uglifyjs src/models/* src/fr
ontend.js -m -c -o build/app.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the dice_simulator_2015@1.0.0 uglify script 'uglifyjs
src/models/* src/frontend.js -m -c -o build/app.js'.
npm ERR! Make sure you have the latest version of node.js and npm instal
led.
npm ERR! If you do, this is most likely a problem with the dice_simulato
r_2015 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! uglifyjs src/models/* src/frontend.js -m -c -o build/app.js
npm ERR! You can get information on how to open an issue for this projec
t with:
npm ERR! npm bugs dice_simulator_2015
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls dice_simulator_2015
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/treehouse/workspace/npm-debug.log
Also treehouse workspaces keeps failing, refreshing, and losing all of my progress.
It really sucks that I have to drudge through this stuff to complete the javascript course!
1 Answer
![Neil McPartlin](https://secure.gravatar.com/avatar/28c97e648f2f03d369da419a0365bdcb?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Neil McPartlin
14,662 PointsHi James. About 'uglifyjs', if you would like to make a 'snapshot' of your workspace, I'd be happy to take a look at it for you. I have just covered this course and yes it is old, but I didn't stagger over any tripwires.
Based on what you have shown above, I think your uglifyjs entry in your package.json is OK. I also wondered whether you had previously deleted your entire node_modules folder. I deleted mine then ran npm run uglify
. I got exactly the same error message as you except, where you have a blank line, I got npm WARN Local package.json exists, but node_modules missing, did you mean to install?
So as mentioned by Iagor, it would be worth checking that 'uglify-js' is installed. Try npm list uglify-js
. Assuming it is, and as shown in the video around the 2 minute mark, enter this in your console...
node_modules/.bin/uglifyjs src/models/* src/frontend.js -m -c -o build/app.js
...to make sure this works independently of your package.json entry.
As for your complaint about workspaces, I see this too a lot, once or twice an hour. I don't have the best of Internet connections but I can live with it. I have developed a nervous twitch so that I am constantly using CTRL+S so that when I lose the connection, I don't lose the data too. I'm about to hit the 100 workspace limit too so as Iagor says, I may well do more coding locally instead.
Iagor Moraes
18,678 PointsIagor Moraes
18,678 PointsMy friend, i do recommend you to save all your progress locally, about your "uglifyjs", do you run "npm install --save uglifyjs" ?