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 Express Basics (2015) Doing more with Express Using β€œexpress-generator” to Start an Express Project

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,735 Points

Why did "node .bin/www" throw an error?

Brendans-MacBook-Pro:TESTAPP brendan.whiting$ node .bin/www
module.js:327
    throw err;
    ^

Error: Cannot find module '/Users/brendan.whiting/Projects/TESTAPP/.bin/www'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:134:18)
    at node.js:962:3
Brendans-MacBook-Pro:TEXTAPP brendan.whiting$ npm start

> TESTAPP@0.0.0 start /Users/brendan.whiting/Projects/TESTAPP
> node ./bin/www

GET / 200 445.632 ms - 170
GET / 200 24.364 ms - 170
GET /stylesheets/style.css 200 3.912 ms - 111

I did 'node .bin/www' and got an error. npm start did work. I'm just wondering why the other way didn't.

Sam Hall
Sam Hall
Courses Plus Student 8,636 Points

Hi Brendan,

You're missing a slash.

It should be node ./bin/www not node .bin/www.

The error comes because there is no folder called .bin. You could also use node bin/www.

Sam