Реагирование скриптов, не работающих на среду разработки -Openshift - PullRequest
0 голосов
/ 13 февраля 2020

Я развертываю свое приложение React, Node на платформе контейнера openshift.
Я одновременно запускаю команду на бэкэнде. Бэкэнд работает без проблем. Интерфейс вызывает проблемы.

Я одновременно запускаю команду, которая находится в пакете. 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\" ",

Я пробовал следующее ни один не работает

"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, внутренняя папка работает без каких-либо проблем

Может кто-нибудь сообщить мне, что куда я иду не так?

1 Ответ

0 голосов
/ 07 марта 2020

Спасибо, @jonrsharpe. Я передаю ответ от бэкэнда и развернутой производственной сборки. Небольшое изменение в docker творило чудеса. Я получил +1 голосов к вашему комментарию

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...