我在将AEM与反应连接时运行"mvn clean install"时遇到问题



我正在按照教程 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全新安装"时遇到问题,并且我能够正确执行前面的步骤。

C:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-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:UsersTEJA.m2repositorycomgithubeirslettnode10.8.0node-10.8.0-win-x64.exe to C:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-appnodenode.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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-appnodenode.exe" (in directory "C:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-app>npm install aem-clientlib-generator --save-dev
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ aem-clientlib-generator@1.4.4
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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-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:UsersTEJA.m2repositorycomgithubeirslettnode10.8.0node-10.8.0-win-x64.exe to C:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-appnodenode.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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-appnodenode.exe" (in directory "C:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-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:UsersTEJADesktopStart-aem-wknd-events-reactStartaem-guides-wknd-eventsreact-app>mvn clean install

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

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

请参阅 GitHub 上的问题 487

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

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

通常这些是 linux 命令,将无法在 Windows 机器中工作。您可以尝试在 linux 机器中安装它吗?

最新更新