我一直在尝试通过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? 甚至这个错误在说什么
答案 0 :(得分:0)
该错误并非特定于Azure平台,而是说它找不到安装的Node,或者您可能未在环境变量中设置它。
尝试使用-
检查节点版本node -v
如果上述情况都很好,那么您的npm软件包之一的不同版本肯定存在问题。 在这种情况下,请尝试使用-
用新版本的node重建npm软件包。npm rebuild
其他“重新安装”系统上的节点,并检查以上命令是否有效,这意味着您的节点已成功安装。