Запуск сценариев реакции через frontend-maven-plugin не работает? - PullRequest
0 голосов
/ 20 июня 2019

У меня есть родительский проект Maven, который включает в себя отдельный проект внешнего интерфейса.

Когда я захожу с помощью cmd в папку внешнего интерфейса и запускаю "npm run build" все отлично работает.

Когда я запускаю "mvn clean install -PautoInstallPackage" из моего родительского файла pom.xml, родительский файл pom.xml считывает файл pom.xml в папке внешнего интерфейса и выполняет ту же команду с помощью внешний интерфейс-плагин

"npm run build" , но это не работает.

Теперь, если я добавлю аргумент в frontend-maven-plugin как npm, запустите build --force

тогда общая сборка maven завершается успешно, но файлы не компилируются, она просто игнорирует ошибку и продолжает работу.

Ниже приведен журнал для чистой установки mvn

[INFO] Running 'npm run build' in /Users/okaunds/Documents/Oliver/DTC/Repos/DTC-React-App/react-app
[INFO] 
[INFO] > react-app@0.1.0 build /Users/okaunds/Documents/Oliver/DTC/Repos/DTC-React-App/react-app
[INFO] > npm-run-all pre-deploy deploy post-deploy
[INFO] 
[INFO] 
[INFO] > react-app@0.1.0 pre-deploy /Users/okaunds/Documents/Oliver/DTC/Repos/DTC-React-App/react-app
[INFO] > cp src/index.js src/index-backup.js && cp src/deploy.js src/index.js
[INFO] 
[INFO] 
[INFO] > react-app@0.1.0 deploy /Users/okaunds/Documents/Oliver/DTC/Repos/DTC-React-App/react-app
[INFO] > react-scripts build && clientlib --verbose
[INFO] 
[INFO] Creating an optimized production build...
[INFO] Failed to compile.
[INFO] 
[INFO] ./src/components/commons/header/header.scss
[INFO] Error: Missing binding /Users/okaunds/Documents/Oliver/DTC/Repos/DTC-React-App/react-app/node_modules/node-sass/vendor/darwin-x64-64/binding.node
[INFO] Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 10.x
[INFO] 
[INFO] Found bindings for the following environments:
[INFO]   - OS X 64-bit with Node.js 8.x
[INFO] 
[INFO] This usually happens because your environment has changed since running `npm install`.
[INFO] Run `npm rebuild node-sass` to download the binding for your current environment.
[INFO] 
[INFO] 
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! react-app@0.1.0 deploy: `react-scripts build && clientlib --verbose`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the react-app@0.1.0 deploy script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     /Users/okaunds/.npm/_logs/2019-06-20T10_09_39_830Z-debug.log
[ERROR] ERROR: "deploy" exited with 1.
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! react-app@0.1.0 build: `npm-run-all pre-deploy deploy post-deploy`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the react-app@0.1.0 build script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     /Users/okaunds/.npm/_logs/2019-06-20T10_09_39_854Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Consumer Direct 0.0.1-SNAPSHOT ..................... SUCCESS [  1.039 s]
[INFO] Consumer Direct - React App 0.0.1-SNAPSHOT ......... FAILURE [ 17.079 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.237 s
[INFO] Finished at: 2019-06-20T15:39:39+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm run build) on project consumer-direct.react: Failed to run task: 'npm run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :consumer-direct.react
...