简体   繁体   English

在Azure上部署Node应用程序时出错

[英]Getting errors while deploying Node app on Azure

I have been trying to deploy Node app by Azure devops. 我一直在尝试通过Azure devops部署Node应用程序。 I made a ci/cd pipeline and then connect it with git repo of mine. 我做了一个ci / cd管道,然后将其与我的git repo连接起来。

https://github.com/alpitanand/NodeAuth

This is working flawlessly on Heroku, and in Azure its throwing this error. 这在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

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. 我真的似乎无法弄清楚为什么,之前有一些bcrypt错误,所以我用bcryptjs替换了bcrypt,因为Stackoverflow上有一个解决方案。

Any idea how to deploy it over to Azure? 知道如何将其部署到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. 该错误不是特定于Azure平台,而是说它找不到安装的Node,或者您可能没有在环境变量中设置它。

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. 如果以上情况都很好,那么您的npm软件包之一的不同版本肯定存在问题。 In that case try rebuilding the npm packages with new version of node by using - 在这种情况下,请尝试使用新版本的node重建npm软件包-

npm rebuild

Else Reinstall node on the system and check if the above command works, meaning your node is installed successfully. 重新安装系统上的Else节点,并检查以上命令是否有效,这意味着您的节点已成功安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在天蓝色中部署功能应用程序时出现错误 - While deploying function app in azure getting error Azure 应用服务在部署 REACT JS 应用程序时出错 - Azure App Service Getting error while deploying REACT JS application 在Azure Functions上部署节点应用程序 - Deploying a Node app on Azure Functions 在Azure上部署时无法将Node.js应用连接到React.js应用 - Unable to connect Node.js app to React.js app while deploying on Azure 将 Python Flask 应用程序部署到 Azure 应用程序服务时出现错误 ModuleNotFoundError: No module named 'spacy' - While Deploying Python Flask App to Azure App Service getting error ModuleNotFoundError: No module named 'spacy' 在Windows Azure上部署节点/ Express应用程序时出错 - Error deploying a node/Express app on Windows Azure 将节点 js 套接字 io 应用程序部署到 azure - Deploying a node js socket io app to azure 将Typescript Node.js部署到Azure Web App-出现``服务不可用''错误 - Deploying a typescript node.js to Azure Web App - getting 'service unavailable' error 将Web应用程序部署到Azure时出现授权错误 - Authorization error while deploying web app to azure 通过 git 存储库将我的应用程序部署到 azure 时出现错误 - I am getting an error while deploying my app to azure through git repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM