TypeScript-Node-Starter icon indicating copy to clipboard operation
TypeScript-Node-Starter copied to clipboard

App Service: "Application Error" - Cannot find module '../lib/utils/unsupported.js'

Open simkessy opened this issue 6 years ago • 1 comments

I've tried to follow these steps but the application is now saying "Application Error"

I looked at the logs and I see this:

Debugger listening on ws://0.0.0.0:49494/703f9862-c7bf-4f73-8803-e3de51b27f78
For help see https://nodejs.org/en/docs/inspector
module.js:549
    throw err;
    ^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /home/site/wwwroot/node_modules/.bin/npm:19:21
    at Object.<anonymous> (/home/site/wwwroot/node_modules/.bin/npm:152:3)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-06-10T03_44_47_900Z-debug.log

I've deployed using Node LTS 10, 8 and 6.

I'm using DevOps to deploy:

image

Pipelines: Agent Pool Ubuntu 1604 Get Sources: Azure Repos npm i npm@latest npm i -g typescript ts-lint npm i npm run build

image

Package.js scripts:

  "scripts": {
    "start": "npm run serve",
    "serve": "node dist/index.js",
    "prebuild": "tslint -c tslint.json -p tsconfig.json --fix 'src/**/*'",
    "build": "tsc",
    "dev": "nodemon --exec ts-node src\\index.ts",
    "d": "nodemon -r esm src\\index.ts",
    "check-types": "tsc",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

App Service Files:

image

I googled the NPM Error and all the suggestions I found has to do with deleting Node but I'm assuming every time I push a build a new node_modules is installed so I'm not sure where to go from there.

EDIT:

So I just tried deploying it through the VS Code extension and it worked without problem. Which is great. However, I'd really like for this to working through Pipelines using DevOps so I can setup a CI/CD process. Any ideas why it might be failed through pipelines?

simkessy avatar Jun 10 '19 16:06 simkessy

Can you switch to the 10? (the latest version should work OK with the 10 TLS release). We are using Node 10 with Azure DevOps at work for very different task and yet it never failed.

peterblazejewicz avatar Jul 05 '19 20:07 peterblazejewicz