question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't deploy my app on Azure

See original GitHub issue

Hi.

I have a problem with deploying the app in Azure.

The command: npm run start generates the next error:

2019-09-17T17:32:15.075119582Z > myexpressapp@0.0.0 start /home/site/wwwroot
2019-09-17T17:32:15.075135283Z > cross-env ENV_FILE=production node -r ./env -r module-alias/register ./dist/start.js
2019-09-17T17:32:15.075140583Z 
2019-09-17T17:32:15.611200168Z internal/modules/cjs/loader.js:583
2019-09-17T17:32:15.611228570Z     throw err;
2019-09-17T17:32:15.611233470Z     ^
2019-09-17T17:32:15.611237070Z 
2019-09-17T17:32:15.611240770Z Error: Cannot find module '..'
2019-09-17T17:32:15.611244570Z     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
2019-09-17T17:32:15.611248670Z     at Function.Module._load (internal/modules/cjs/loader.js:507:25)
2019-09-17T17:32:15.611253171Z     at Module.require (internal/modules/cjs/loader.js:637:17)
2019-09-17T17:32:15.611257071Z     at require (internal/modules/cjs/helpers.js:22:18)
2019-09-17T17:32:15.611260671Z     at Object. (/home/site/wwwroot/node_modules/.bin/cross-env:4:16)
2019-09-17T17:32:15.611264971Z     at Module._compile (internal/modules/cjs/loader.js:689:30)
2019-09-17T17:32:15.611268571Z     at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
2019-09-17T17:32:15.611272271Z     at Module.load (internal/modules/cjs/loader.js:599:32)
2019-09-17T17:32:15.611275871Z     at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
2019-09-17T17:32:15.611279672Z     at Function.Module._load (internal/modules/cjs/loader.js:530:3)
2019-09-17T17:32:15.671881457Z npm ERR! code ELIFECYCLE
2019-09-17T17:32:15.700250121Z npm ERR! errno 1
2019-09-17T17:32:15.708948777Z npm ERR! myexpressapp@0.0.0 start: `cross-env ENV_FILE=production node -r ./env -r module-alias/register ./dist/start.js`
2019-09-17T17:32:15.709719209Z npm ERR! Exit status 1
2019-09-17T17:32:15.710555543Z npm ERR! 
2019-09-17T17:32:15.711515983Z npm ERR! Failed at the myexpressapp@0.0.0 start script.
2019-09-17T17:32:15.718314961Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-17T17:32:15.816054370Z 
2019-09-17T17:32:15.817110013Z npm ERR! A complete log of this run can be found in:
2019-09-17T17:32:15.817851744Z npm ERR!     /root/.npm/_logs/2019-09-17T17_32_15_719Z-debug.log

So… I need your help, please!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
elkin0727commented, Sep 19, 2019

Finally, I found the problem. The module cross-env was generating the error.

I found the solution on stackoverflow:

In summary, we have to call the internal command cross-env:

"start": "node node_modules/cross-env/dist/bin/cross-env.js ENV_FILE=production node -r ./env -r module-alias/register ./dist/start.js",

Thank you 😉

0reactions
seanpmaxwellcommented, Sep 19, 2019

express-generator-typescript uses Number(process.env.PORT || 3000). So I don’t think that’s the issue. It’s missing a library or a .js file. Try this, transpile your app locally. Deploy it. Go into the remote env and in the project folder run npm i.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not deploy to Azure app service - Microsoft Q&A
I have been trying for over a week to get code deployed to a deployment slot on Azure. The code is a modified...
Read more >
Cant deploy to Azure App Service, remote server returns 500 ...
Your open channel to Microsoft engineering teams. Select a page ... Cant deploy to Azure App Service, remote server returns 500...
Read more >
Cannot deploy my web application. I get the following error
Angular spa from vs code. Windows server. I get the error when deploying to the production slot. I just started getting the error...
Read more >
Cannot deploy to Azure App Service from VS Code or CLI
You could re-download the publish profile from Azure portal, and import publish settings in Visual Studio for deployment. In the Azure portal, ...
Read more >
Deploy an ASP.NET Web App in Azure App Service
Once the app is running fine, you can verify by doing some changes to the UI. So that you make sure that your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found