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 Build a REST API With Express Building API Routes in Express Building the Question Routes

nishantr
nishantr
6,326 Points

getting an error

SyntaxError: Unexpected identifier at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object.<anonymous> (C:\projects\qa-rest-api\app.js:5:14) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10)

if i run the server i am getting this error

FΓ‘bio Nascimento
FΓ‘bio Nascimento
10,418 Points

Can you paste the contents of vm.js around line 53?

Fernando Nazario
Fernando Nazario
5,553 Points

We can't tell exactly we your error is, unless you print your code here, but just by seeing the error, it's probably something with the module.exports ou require() in one or more of your js files

1 Answer

Tom Geraghty
Tom Geraghty
24,174 Points

Pasting in your error the first place to look would be app.js, line 5, the character 14 spaces from the left margin

C:\projects\qa-rest-api\app.js:5:14