gpt4 book ai didi

docker - 部署解析服务器时docker-compose up命令引发错误

转载 作者:行者123 更新时间:2023-12-02 21:33:59 24 4
gpt4 key购买 nike

我试图在docker中运行我的解析服务器应用程序,但是在运行命令“docker-compose up”时,它可以正常运行几秒钟,然后引发此错误:
解析命令行时出错:无法识别的选项'--break-mongo'
之后,它还会引发与npm相关的错误-

my-parse-app |
my-parse-app | > app@1.0.0 start /parse-server
my-parse-app | > parse-server "/parse-server/config/config.json"
my-parse-app |
my-parse-app |/parse-server/node_modules/parse/lib/node/ParseObject.js:1301
my-parse-app | async exists(options
my-parse-app | ^^^^^^
my-parse-app |
my-parse-app | SyntaxError: Unexpected identifier
my-parse-app | at createScript (vm.js:56:10)
my-parse-app | at Object.runInThisContext (vm.js:97:10)
my-parse-app | at Module._compile (module.js:549:28)
my-parse-app | at Object.Module._extensions..js (module.js:586:10)my-parse-app | at Module.load (module.js:494:32)
my-parse-app | at tryModuleLoad (module.js:453:12)
my-parse-app | at Function.Module._load (module.js:445:3)
my-parse-app | at Module.require (module.js:504:17)
my-parse-app | at require (internal/module.js:20:19)
my-parse-app | at Object.(/parse-server/node_modules/parse/lib/node/ParseRole.js:12:43)
my-parse-app |
my-parse-app | npm ERR! Linux 4.19.128-microsoft-standard
my-parse-app | npm ERR! argv "/usr/local/bin/node""/usr/local/bin/npm" "start" "--" "/parse-server/config/config.json"
my-parse-app | npm ERR! node v6.17.1
my-parse-app | npm ERR! npm v3.10.10
my-parse-app | npm ERR! code ELIFECYCLE
my-parse-app | npm ERR! app@1.0.0 start: parse-server "/parse-server/config/config.json"
my-parse-app | npm ERR! Exit status 1
my-parse-app | npm ERR!
my-parse-app | npm ERR! Failed at the app@1.0.0 start script'parse-server "/parse-server/config/config.json"'.
my-parse-app | npm ERR! Make sure you have the latest version ofnode.js and npm installed.
my-parse-app | npm ERR! If you do, this is most likely a problem withthe app package,
my-parse-app | npm ERR! not with npm itself.
my-parse-app | npm ERR! Tell the author that this fails on yoursystem:
my-parse-app | npm ERR! parse-server"/parse-server/config/config.json"
my-parse-app | npm ERR! You can get information on how to open anissue for this project with:
my-parse-app | npm ERR! npm bugs app
my-parse-app | npm ERR! Or if that isn't available, you can get theirinfo via:
my-parse-app | npm ERR! npm owner ls app
my-parse-app | npm ERR! There is likely additional logging outputabove.
my-parse-app |
my-parse-app | npm ERR! Please include the following file with anysupport request:
my-parse-app | npm ERR! /parse-server/npm-debug.log
my-parse-app exited with code 1


我的 docker 组成:
version: "2"
services:
# Node.js parse-server application image
app:
build: ./app
command: npm start -- /parse-server/config/config.json
container_name: my-parse-app
volumes:
- ./app:/parse-server/
- /parse-server/node_modules
ports:
- "1337:1337"
links:
- mongo
# MongoDB image

mongo:
image: mongo:latest
container_name: mongo-database
ports:
- "27017:27017"
volumes_from:
- mongodata
# MongoDB image volume for persistence
mongodata:
image: mongo
volumes:
- ./data/db:/data/db
command:
- --break-mongo
我的Dockerfile
FROM node:boron
RUN mkdir -p /parse-server
WORKDIR /parse-server
COPY . /parse-server
RUN npm install
EXPOSE 1337
CMD ["npm","start"]
The break-mongo error
The npm error

最佳答案

看来您使用的是旧版本的节点,可能是问题所在。将docker文件的第一行切换为:

FROM node:erbium

关于docker - 部署解析服务器时docker-compose up命令引发错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63897306/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com