簡體   English   中英

在Azure上部署Node應用程序時出錯

[英]Getting errors while deploying Node app on Azure

我一直在嘗試通過Azure devops部署Node應用程序。 我做了一個ci / cd管道,然后將其與我的git repo連接起來。

https://github.com/alpitanand/NodeAuth

這在Heroku上運行正常,在Azure中拋出此錯誤。

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

我真的似乎無法弄清楚為什么,之前有一些bcrypt錯誤,所以我用bcryptjs替換了bcrypt,因為Stackoverflow上有一個解決方案。

知道如何將其部署到Azure嗎? 甚至這個錯誤在說什么

該錯誤不是特定於Azure平台,而是說它找不到安裝的Node,或者您可能沒有在環境變量中設置它。

嘗試使用-檢查節點版本

node -v

如果以上情況都很好,那么您的npm軟件包之一的不同版本肯定存在問題。 在這種情況下,請嘗試使用新版本的node重建npm軟件包-

npm rebuild

重新安裝系統上的Else節點,並檢查以上命令是否有效,這意味着您的節點已成功安裝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM