Tuesday, 11 July 2017

Learning how to build RESTful APIs using Node.Js and Mongodb Error

"SOLVED"am now following another tutorial and things seem to be working fine on that end. Not sure what went wrong on this end.http://ift.tt/2vb1fAv've been following this guide to learn how to build an API, but somehow at the step where I should do:npm run start I encounter this error:C:\Users\ROG\Desktop\webapi\todolistapi\server.js:1 (function (exports, require, module, __filename, __dirname) { ��v ^ SyntaxError: Invalid or unexpected token at createScript (vm.js:74:10) at Object.runInThisContext (vm.js:116:10) at Module._compile (module.js:533:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Function.Module.runMain (module.js:605:10) at startup (bootstrap_node.js:158:16) at bootstrap_node.js:575:3 inside server.jsvar express = require('express'); var app = express(); var port = process.env.PORT || 3000; app.listen(port); console.log('todo list RESTful API server started on: ' + port); Stuff I have tried:*Reinstalling Node to v8.1.3*Deleting the node_module and reinstalling both express and nodemon*Moving the file from D: to C:edit: formatting

Submitted July 12, 2017 at 02:37AM by Lemawn

No comments:

Post a Comment