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

CJ Williams
CJ Williams
34,372 Points

cannot run npm run serve to start Angular app

getting this error message:

... C:_sites\photoblog>npm run start npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\CJ\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "start" npm ERR! node v4.4.7 npm ERR! npm v3.10.5

npm ERR! missing script: start npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! C:_sites\photoblog\npm-debug.log ...

1 Answer

Alex Warner
PLUS
Alex Warner
Courses Plus Student 4,987 Points

In my experience with Angular 2 (couldn't tell from your question if you're using 1.x or 2.x) and the Angular 2 CLI the command is either: ng serve or npm start

There should be a file called package.json in your root folder. Open the file and look under "scripts" for the commands included. In all my non-Angular experience with npm you would issue the command as you've been doing, npm run <command>. But I've noticed in Angular (and never bothered to look into why) you don't use run, just npm <command>

I hope this is helpful.

CJ Williams
CJ Williams
34,372 Points

It was an issue with Node not updating as it should through CLI. I downloaded directly from the site, and all is well now. Tricky bugger. Thanks for your help tho, Alex. :)