[连接AEM与react时运行“ mvn clean install”时遇到问题

问题描述 投票:0回答:2

我正在遵循https://helpx.adobe.com/experience-manager/kt/sites/using/getting-started-spa-wknd-tutorial-develop/react/chapter-0.html#integrate-react-app教程,将reactjs与AEM集成,运行“ mvn clean install”时遇到问题,并且能够正确执行先前的步骤。

C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< com.adobe.aem.guides:aem-guides-wknd-events.react >----------
[INFO] Building WKND Events - React App 0.0.1-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ aem-guides-wknd-events.react ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ aem-guides-wknd-events.react ---
[INFO]
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) @ aem-guides-wknd-events.react ---
[INFO] Installing node version v10.8.0
[INFO] Copying node binary from C:\Users\TEJA\.m2\repository\com\github\eirslett\node\10.8.0\node-10.8.0-win-x64.exe to C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app\node\node.exe
[INFO] Installed node locally.
[INFO] NPM 6.2.0 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ aem-guides-wknd-events.react ---
[INFO] Running 'npm install' in C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.810 s
[INFO] Finished at: 2019-10-20T23:44:11+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm install) on project aem-guides-wknd-events.react: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app\node\node.exe" (in directory "C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app"): CreateProcess error=193, %1 is not a valid Win32 application -> [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

C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app>npm install aem-clientlib-generator --save-dev
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ [email protected]
updated 1 package and audited 33138 packages in 31.111s
found 1041 vulnerabilities (71 low, 8 moderate, 960 high, 2 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< com.adobe.aem.guides:aem-guides-wknd-events.react >----------
[INFO] Building WKND Events - React App 0.0.1-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ aem-guides-wknd-events.react ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ aem-guides-wknd-events.react ---
[INFO]
[INFO] --- frontend-maven-plugin:1.6:install-node-and-npm (install node and npm) @ aem-guides-wknd-events.react ---
[INFO] Installing node version v10.8.0
[INFO] Copying node binary from C:\Users\TEJA\.m2\repository\com\github\eirslett\node\10.8.0\node-10.8.0-win-x64.exe to C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app\node\node.exe
[INFO] Installed node locally.
[INFO] NPM 6.2.0 is already installed.
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ aem-guides-wknd-events.react ---
[INFO] Running 'npm install' in C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.590 s
[INFO] Finished at: 2019-10-20T23:45:29+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (npm install) on project aem-guides-wknd-events.react: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app\node\node.exe" (in directory "C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app"): CreateProcess error=193, %1 is not a valid Win32 application -> [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

C:\Users\TEJA\Desktop\Start-aem-wknd-events-react\Start\aem-guides-wknd-events\react-app>mvn clean install
aem single-page-application aem-6
2个回答
0
投票

我在其他项目中使用frontend-maven-plugin时都没有问题,通过阅读错误消息,似乎npm.exe可执行文件被损坏很普遍。

尝试删除.m2插件目录或指定自定义npm版本<npmVersions>

请参见issue 487 on GitHub


0
投票

问题可能出在react / webpack配置文件之一的脚本中。在目录中搜索“%1”,%1可以作为参数传递到脚本/命令中]

%1不是有效的Win32应用程序

通常,这些是linux命令,在Windows计算机中将无法运行。您可以尝试在Linux机器上安装它吗?

© www.soinside.com 2019 - 2024. All rights reserved.