简体   繁体   中英

Getting errors while deploying Node app on Azure

I have been trying to deploy Node app by Azure devops. I made a ci/cd pipeline and then connect it with git repo of mine.

https://github.com/alpitanand/NodeAuth

This is working flawlessly on Heroku, and in Azure its throwing this error.

2019-09-17T14:20:14.679869794Z npm ERR! 
2019-09-17T14:20:14.680223095Z npm ERR! Failed at the blik-backend@1.0.0 start script.
2019-09-17T14:20:14.680700197Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-17T14:20:14.691747427Z 
2019-09-17T14:20:14.692641430Z npm ERR! A complete log of this run can be found in:
2019-09-17T14:20:14.701075953Z npm ERR!     /root/.npm/_logs/2019-09-17T14_20_14_681Z-debug.log

2019-09-17T14:20:17.924855181Z   _____                               
2019-09-17T14:20:17.924882981Z   /  _  \ __________ _________   ____  
2019-09-17T14:20:17.924887981Z  /  /_\  \___   /  |  \_  __ \_/ __ \ 
2019-09-17T14:20:17.924891381Z /    |    \/    /|  |  /|  | \/\  ___/ 
2019-09-17T14:20:17.924894681Z \____|__  /_____ \____/ |__|    \___  >
2019-09-17T14:20:17.924898481Z         \/      \/                  \/ 
2019-09-17T14:20:17.924901881Z A P P   S E R V I C E   O N   L I N U X
2019-09-17T14:20:17.924905181Z 
2019-09-17T14:20:17.924908081Z Documentation: http://aka.ms/webapp-linux
2019-09-17T14:20:17.924911181Z NodeJS quickstart: https://aka.ms/node-qs
2019-09-17T14:20:17.924914281Z NodeJS Version : v10.1.0
2019-09-17T14:20:17.924917382Z 
2019-09-17T14:20:18.013115426Z /opt/startup/init_container.sh: line 32: [: ==: unary operator expected
2019-09-17T14:20:18.024420457Z Oryx Version : 0.2.20190730.1, Commit: 4ef0d5854df39c57605e59bb6d255215cc85468a
2019-09-17T14:20:18.024882958Z 
2019-09-17T14:20:18.025403060Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2019-09-17T14:20:18.031053175Z Could not find operation ID in manifest. Generating an operation id...
2019-09-17T14:20:18.031732177Z Build Operation ID: 70c4c999-4d42-495f-b6ae-153e17a9fb16
2019-09-17T14:20:18.897937476Z Writing output script to '/opt/startup/startup.sh'
2019-09-17T14:20:18.908081904Z Running #!/bin/sh
2019-09-17T14:20:18.908612406Z 
2019-09-17T14:20:18.909041107Z # Enter the source directory to make sure the script runs where the user expects
2019-09-17T14:20:18.909053507Z cd "/home/site/wwwroot"
2019-09-17T14:20:18.909057907Z 
2019-09-17T14:20:18.909061207Z if [ -z "$PORT" ]; then
2019-09-17T14:20:18.909082807Z         export PORT=8080
2019-09-17T14:20:18.916914529Z fi
2019-09-17T14:20:18.923594847Z 
2019-09-17T14:20:18.923609047Z npm start
2019-09-17T14:20:20.537413317Z 
2019-09-17T14:20:20.537446017Z > blik-backend@1.0.0 start /home/site/wwwroot
2019-09-17T14:20:20.537452717Z > node index.js
2019-09-17T14:20:20.537457517Z 
2019-09-17T14:20:20.601789695Z /home/site/wwwroot/node_modules/.bin/node: 1: /home/site/wwwroot/node_modules/.bin/node: /../node/bin/node: not found
2019-09-17T14:20:20.647905123Z npm ERR! file sh
2019-09-17T14:20:20.648966326Z npm ERR! code ELIFECYCLE
2019-09-17T14:20:20.657901451Z npm ERR! errno ENOENT
2019-09-17T14:20:20.657918051Z npm ERR! syscall spawn
2019-09-17T14:20:20.657922851Z npm ERR! blik-backend@1.0.0 start: `node index.js`
2019-09-17T14:20:20.657926651Z npm ERR! spawn ENOENT
2019-09-17T14:20:20.657946751Z npm ERR! 
2019-09-17T14:20:20.657951551Z npm ERR! Failed at the blik-backend@1.0.0 start script.
2019-09-17T14:20:20.657955151Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-17T14:20:20.675093098Z 
2019-09-17T14:20:20.675929600Z npm ERR! A complete log of this run can be found in:
2019-09-17T14:20:20.676687003Z npm ERR!     /root/.npm/_logs/2019-09-17T14_20_20_665Z-debug.log

2019-09-17T14:28:19.916470497Z   _____                               
2019-09-17T14:28:19.916535397Z   /  _  \ __________ _________   ____  
2019-09-17T14:28:19.916558597Z  /  /_\  \___   /  |  \_  __ \_/ __ \ 
2019-09-17T14:28:19.916562297Z /    |    \/    /|  |  /|  | \/\  ___/ 
2019-09-17T14:28:19.916565597Z \____|__  /_____ \____/ |__|    \___  >
2019-09-17T14:28:19.916586397Z         \/      \/                  \/ 
2019-09-17T14:28:19.916590197Z A P P   S E R V I C E   O N   L I N U X
2019-09-17T14:28:19.916593697Z 
2019-09-17T14:28:19.916596797Z Documentation: http://aka.ms/webapp-linux
2019-09-17T14:28:19.916600097Z NodeJS quickstart: https://aka.ms/node-qs
2019-09-17T14:28:19.916603497Z NodeJS Version : v10.1.0
2019-09-17T14:28:19.916606797Z 
2019-09-17T14:28:20.018392060Z /opt/startup/init_container.sh: line 32: [: ==: unary operator expected
2019-09-17T14:28:20.043739625Z Oryx Version : 0.2.20190730.1, Commit: 4ef0d5854df39c57605e59bb6d255215cc85468a
2019-09-17T14:28:20.044306927Z 
2019-09-17T14:28:20.044799828Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2019-09-17T14:28:20.045299929Z Could not find operation ID in manifest. Generating an operation id...
2019-09-17T14:28:20.045315629Z Build Operation ID: e82de656-79cd-4133-a32d-d035abf0d494
2019-09-17T14:28:20.976953935Z Writing output script to '/opt/startup/startup.sh'
2019-09-17T14:28:20.985060056Z Running #!/bin/sh
2019-09-17T14:28:20.985563257Z 
2019-09-17T14:28:20.985575857Z # Enter the source directory to make sure the script runs where the user expects
2019-09-17T14:28:20.986130459Z cd "/home/site/wwwroot"
2019-09-17T14:28:20.986206059Z 
2019-09-17T14:28:20.986214559Z if [ -z "$PORT" ]; then
2019-09-17T14:28:20.986219359Z         export PORT=8080
2019-09-17T14:28:20.986224059Z fi
2019-09-17T14:28:20.986228259Z 
2019-09-17T14:28:20.986673860Z npm start
2019-09-17T14:28:22.816013084Z 
2019-09-17T14:28:22.816040284Z > blik-backend@1.0.0 start /home/site/wwwroot
2019-09-17T14:28:22.816045684Z > node index.js
2019-09-17T14:28:22.816048984Z 
2019-09-17T14:28:22.945075717Z /home/site/wwwroot/node_modules/.bin/node: 1: /home/site/wwwroot/node_modules/.bin/node: /../node/bin/node: not found
2019-09-17T14:28:22.956013445Z npm ERR! file sh
2019-09-17T14:28:22.965780470Z npm ERR! code ELIFECYCLE
2019-09-17T14:28:22.965850471Z npm ERR! errno ENOENT
2019-09-17T14:28:22.965947371Z npm ERR! syscall spawn
2019-09-17T14:28:22.973005389Z npm ERR! blik-backend@1.0.0 start: `node index.js`
2019-09-17T14:28:22.973659691Z npm ERR! spawn ENOENT
2019-09-17T14:28:22.974356793Z npm ERR! 
2019-09-17T14:28:22.974849694Z npm ERR! Failed at the blik-backend@1.0.0 start script.
2019-09-17T14:28:22.991353737Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-09-17T14:28:23.009177283Z 
2019-09-17T14:28:23.010328385Z npm ERR! A complete log of this run can be found in:
2019-09-17T14:28:23.011081387Z npm ERR!     /root/.npm/_logs/2019-09-17T14_28_23_000Z-debug.log

I really can't seem to figure out why, earlier there was some bcrypt error so I replaced bcrypt with bcryptjs, as there was a solution on Stackoverflow.

Any idea how to deploy it over to Azure? Or even what this error is saying

The error is not specific to Azure platform but it says that it cannot find Node installed or maybe you have not set it in environment variables.

Try checking node version with -

node -v

If the above is fine then you must be having issues with different version of one of the npm package. In that case try rebuilding the npm packages with new version of node by using -

npm rebuild

Else Reinstall node on the system and check if the above command works, meaning your node is installed successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM