2

I'm deploying angular 7 app to Azure using bitbucket, I'm using this script in package.json

"scripts": { "ng": "ng", "start-ng": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "postinstall": "npm run build" }, "engines": { "node": "8.11.1" },

and set Application directory to

site\wwwroot\dist\myapp

but it failed, here is the log

Running deployment command

I've deployed angular 5 app to Azure in the same way previously and it works fine

Updates

I've set the default node and npm version in package.json and add them as default variable in Application setting so the new errors is log

9
  • Hi Kenada, welcome to S.O!! How are you deploying your code to azure? Are you using some kind of functionality like heroku? What is the s.o of your box in azure? Commented Nov 19, 2018 at 14:16
  • Hi @JRichardsz well, I don't use heroku, I'm only execute this script in package.json , by defualt, there is default deployment command from kudu that is executed Commented Nov 19, 2018 at 14:57
  • @JRichardsz I've updated the post, pls have alook Commented Nov 19, 2018 at 15:03
  • I can see in your log, you use windows as server. My first advice is : Windows is not the best choice to work with nodejs. Linux box or a minimal linux docker container is the best choice to work with nodejs in production Commented Nov 19, 2018 at 21:15
  • According to your log, you need a dependency. Try this : npm install --save-dev @angular-devkit/build-angular Commented Nov 19, 2018 at 21:17

2 Answers 2

2

The answer was adding WEBSITE_NODE_DEFAULT_VERSION in Application setting string, even adding

"engines": { "node": "8.11.1" },

in package.json have no effect, another solution is to add issnode.yml file and to project file and add this command to it
nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\8.11.1\node.exe"

Sign up to request clarification or add additional context in comments.

1 Comment

I had zero luck with the app setting. Adding the yml file with the newProcessCommandLine did it for me.
0

You are running version v0.10.40 of Node.js, which is not supported by Angular CLI v6 and above. The official Node.js version that is supported is 8.9 and greater.

Please visit https://nodejs.org/en/ to find the instructions on how to update Node.js

2 Comments

Thanks for answering, I have specified node version in package.json and set "engines" to "8.11.1", I've updated the post
so don't know Why this error is appear!, even I choose node version, and at the beginning in the log you van notice that the selected node version is 8.11.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.