将不 运行 的脚本反应到开发环境 -Openshift
React scripts not running onto devlopement environment -Openshift
我正在将我的 React、Node 应用程序部署到 openshift 容器平台上。
我 运行 在后端同时执行命令。后端 运行 完美无缺。前端导致了问题。
我正在 运行 同时执行这些命令,它们在 package.json 后端文件夹中
"start": "node index.js",
"backend": "nodemon index.js",
"frontend": " npm run start --prefix ../frontend",
"frontendBuilt": "npm run built --prefix ../frontend",
"dev": "concurrently \"npm run backend\" \"npm run frontendBuilt\" ",
我已经尝试了以下 none 有效
"frontend": " npm start --prefix /frontend",
"frontendBuilt": "npm built --prefix /frontend",
"frontend": " npm start --prefix ../frontend",
"frontendBuilt": "npm built --prefix ../frontend",
日志正文如下
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm@6.13.7
3 info using node@v12.2.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle changemaker@1.0.0~predev: changemaker@1.0.0
6 info lifecycle changemaker@1.0.0~dev: changemaker@1.0.0
7 verbose lifecycle changemaker@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle changemaker@1.0.0~dev: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/backend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle changemaker@1.0.0~dev: CWD: /backend
10 silly lifecycle changemaker@1.0.0~dev: Args: [ '-c', 'concurrently "npm run backend" "npm run frontend" ' ]
11 silly lifecycle changemaker@1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle changemaker@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: changemaker@1.0.0 dev: `concurrently "npm run backend" "npm run frontend" `
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:196:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:196:13)
13 verbose stack at maybeClose (internal/child_process.js:1011:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:268:5)
14 verbose pkgid changemaker@1.0.0
15 verbose cwd /backend
16 verbose Linux 4.18.0-147.3.1.el8_1.x86_64
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v12.2.0
19 verbose npm v6.13.7
20 error code ELIFECYCLE
21 error errno 1
22 error changemaker@1.0.0 dev: `concurrently "npm run backend" "npm run frontend" `
22 error Exit status 1
23 error Failed at the changemaker@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Starting the development server...
[1]
[1] The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
[1] npm ERR! frontend@0.1.0 start: `react-scripts start`
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the frontend@0.1.0 start script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! /root/.npm/_logs/2020-02-13T07_34_21_726Z-debug.log
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
npm ERR! changemaker@1.0.0 frontend: ` npm start --prefix ../frontend`
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the changemaker@1.0.0 frontend script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! /root/.npm/_logs/2020-02-13T07_34_21_744Z-debug.log
[1] npm run frontend exited with code 1
如果我 运行 npm run dev
在 openshift 容器后端文件夹中工作完美,没有任何问题
谁能告诉我哪里出错了?
谢谢,@jonrsharpe 我正在为来自后端的反应和已部署的生产构建提供服务。 docker 的微小变化创造了奇迹。我对你的评论投了 +1 票
我正在将我的 React、Node 应用程序部署到 openshift 容器平台上。
我 运行 在后端同时执行命令。后端 运行 完美无缺。前端导致了问题。
我正在 运行 同时执行这些命令,它们在 package.json 后端文件夹中
"start": "node index.js",
"backend": "nodemon index.js",
"frontend": " npm run start --prefix ../frontend",
"frontendBuilt": "npm run built --prefix ../frontend",
"dev": "concurrently \"npm run backend\" \"npm run frontendBuilt\" ",
我已经尝试了以下 none 有效
"frontend": " npm start --prefix /frontend",
"frontendBuilt": "npm built --prefix /frontend",
"frontend": " npm start --prefix ../frontend",
"frontendBuilt": "npm built --prefix ../frontend",
日志正文如下
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'dev' ]
2 info using npm@6.13.7
3 info using node@v12.2.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle changemaker@1.0.0~predev: changemaker@1.0.0
6 info lifecycle changemaker@1.0.0~dev: changemaker@1.0.0
7 verbose lifecycle changemaker@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle changemaker@1.0.0~dev: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/backend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle changemaker@1.0.0~dev: CWD: /backend
10 silly lifecycle changemaker@1.0.0~dev: Args: [ '-c', 'concurrently "npm run backend" "npm run frontend" ' ]
11 silly lifecycle changemaker@1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle changemaker@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: changemaker@1.0.0 dev: `concurrently "npm run backend" "npm run frontend" `
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:196:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:196:13)
13 verbose stack at maybeClose (internal/child_process.js:1011:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:268:5)
14 verbose pkgid changemaker@1.0.0
15 verbose cwd /backend
16 verbose Linux 4.18.0-147.3.1.el8_1.x86_64
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
18 verbose node v12.2.0
19 verbose npm v6.13.7
20 error code ELIFECYCLE
21 error errno 1
22 error changemaker@1.0.0 dev: `concurrently "npm run backend" "npm run frontend" `
22 error Exit status 1
23 error Failed at the changemaker@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Starting the development server...
[1]
[1] The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
[1] npm ERR! frontend@0.1.0 start: `react-scripts start`
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the frontend@0.1.0 start script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! /root/.npm/_logs/2020-02-13T07_34_21_726Z-debug.log
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
npm ERR! changemaker@1.0.0 frontend: ` npm start --prefix ../frontend`
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the changemaker@1.0.0 frontend script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1]
[1] npm ERR! A complete log of this run can be found in:
[1] npm ERR! /root/.npm/_logs/2020-02-13T07_34_21_744Z-debug.log
[1] npm run frontend exited with code 1
如果我 运行 npm run dev
在 openshift 容器后端文件夹中工作完美,没有任何问题
谁能告诉我哪里出错了?
谢谢,@jonrsharpe 我正在为来自后端的反应和已部署的生产构建提供服务。 docker 的微小变化创造了奇迹。我对你的评论投了 +1 票