I have a node.js API App that is being deployed via continuous delivery/deployment in VSO (Visual Studio Online).
I discovered that the app fails when i import modules such as 'express'. I installed 'express' on the azure machine, via Kudo console. But that didnt help.
The run-time error that i see in the output console:
Application has thrown an uncaught exception and is terminated:
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (D:\home\node_modules\tedious\lib\tedious.js:4:29)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Note that i did see this article which is suggesting to use node > 4. But as you can see in my package.json, i am explicitly referring to node > 6.
The package.json looks like this:
{
"name": "my_API_Service",
"engines": {
"node": "6.11",
"npm": "1.1.65"
},
"version": "1.0.0",
"description": "",
"main": "MyService.js",
"dependencies": {
"async": "^2.6.0",
"body-parser": "^1.18.2",
"express": "^4.16.2",
"http": "0.0.0",
"sequelize": "^4.28.6",
"swaggerize-express": "^4.0.5",
"swaggerize-ui": "^1.0.1",
"tedious": "^2.1.5"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-util": "^3.0.8"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://<my_api_service_url>"
},
"author": "",
"license": "ISC"
============= Closed ===============
I finally got my app running (very intuitively might i add) by configuring it on Windows OS (instead of Linux OS). I was really set on having it run on Linux, but it turned out to be a walk thru a mine field.