首页 > 解决方案 > $ mvn clean install -PautoInstallSinglePackage

问题描述

" [INFO] 二进制文件位于 C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\node-sass\vendor\win32-x64-64\binding.node [INFO] 测试二进制文件 [INFO ] 二进制很好 [WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fseven"

我正在关注这个教程: https ://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-setup.html?lang=en#build

[INFO] Binary found at C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\node-sass\vendor\win32-x64-64\binding.node
[INFO] Testing binary
[INFO] Binary is fine
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules\chokidar\node_modules\fsevents):
[INFO] added 1150 packages from 604 contributors in 126.591s
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[ERROR]
[INFO] 
[INFO] --- frontend-maven-plugin:1.7.6:npm (npm run prod) @ aem-guides-wknd.ui.frontend ---
[INFO] Running 'npm run prod' in C:\Users\musal\code\aem-guides-wknd\ui.frontend
[INFO] 
[INFO] > aem-maven-archetype@1.0.0 prod C:\Users\musal\code\aem-guides-wknd\ui.frontend
[INFO] > webpack -p --config ./webpack.prod.js && clientlib --verbose
[INFO]
[INFO] Hash: ffc73eaa92aecbde036f
[INFO] Version: webpack 4.46.0
[INFO] Time: 6708ms
[INFO] Built at: 03/18/2021 1:14:42 AM
[INFO]  1 asset
[INFO] Entrypoint site = clientlib-site/site.js
[INFO]
[INFO] WARNING in ./src/main/webpack/site/main.ts
[INFO] Module Warning (from (webpack)-import-glob-loader/index.js):
[INFO] (Emitted value instead of an instance of Error) Empty results for "import "./**/*.js""
[INFO] NonErrorEmittedError: (Emitted value instead of an instance of Error) Empty results for "import "./**/*.js""
[INFO]     at Object.emitWarning (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\webpack\lib\NormalModule.js:160:16)
[INFO]     at replacer (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\webpack-import-glob-loader\index.js:85:12)
[INFO]     at String.replace (<anonymous>)
[INFO]     at Object.module.exports (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\webpack-import-glob-loader\index.js:91:20)
[INFO]
[INFO] ERROR in ./src/main/webpack/site/main.scss
[INFO] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
[INFO] ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
[INFO] BrowserslistError: C:\Users\musal\code\aem-guides-wknd\ui.frontend contains both browserslist and package.json with browsers
[INFO]     at C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\browserslist\node.js:329:15
[INFO]     at eachParent (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\browserslist\node.js:49:18)
[INFO]     at Object.findConfig (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\browserslist\node.js:305:20)
[INFO]     at Function.loadConfig (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\browserslist\node.js:223:37)
[INFO]     at browserslist (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\browserslist\index.js:411:31)
[INFO]     at Browsers.parse (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\autoprefixer\lib\browsers.js:63:12)
[INFO]     at new Browsers (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\autoprefixer\lib\browsers.js:46:26)
[INFO]     at loadPrefixes (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\autoprefixer\lib\autoprefixer.js:98:20)
[INFO]     at plugin (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\autoprefixer\lib\autoprefixer.js:109:20)
[ERROR] npm ERR! code ELIFECYCLE
[INFO]     at LazyResult.run (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss\lib\lazy-result.js:288:14)
[ERROR] npm ERR! errno 2
[ERROR] npm ERR! aem-maven-archetype@1.0.0 prod: `webpack -p --config ./webpack.prod.js && clientlib --verbose`
[INFO]     at LazyResult.asyncTick (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss\lib\lazy-result.js:212:26)
[ERROR] npm ERR! Exit status 2
[INFO]     at C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss\lib\lazy-result.js:254:14
[ERROR] npm ERR!
[INFO]     at new Promise (<anonymous>)
[ERROR] npm ERR! Failed at the aem-maven-archetype@1.0.0 prod script.
[INFO]     at LazyResult.async (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss\lib\lazy-result.js:250:23)
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO]     at LazyResult.then (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss\lib\lazy-result.js:131:17)
[ERROR]
[INFO]     at Promise.resolve.then.then (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss-loader\src\index.js:142:8)
[ERROR] npm ERR! A complete log of this run can be found in:
[INFO]     at runLoaders (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\webpack\lib\NormalModule.js:316:20)
[ERROR] npm ERR!     C:\Users\musal\AppData\Roaming\npm-cache\_logs\2021-03-18T06_14_42_492Z-debug.log
[INFO]     at C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\loader-runner\lib\LoaderRunner.js:367:11
[INFO]     at C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\loader-runner\lib\LoaderRunner.js:233:18
[INFO]     at context.callback (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
[INFO]     at Promise.resolve.then.then.catch (C:\Users\musal\code\aem-guides-wknd\ui.frontend\node_modules\postcss-loader\src\index.js:208:9)
[INFO]  @ ./src/main/webpack/site/main.ts 1:0-21
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for aem-guides-wknd 0.0.1-SNAPSHOT:
[INFO]
[INFO] aem-guides-wknd .................................... SUCCESS [ 10.794 s]
[INFO] WKND Sites Project - Core .......................... SUCCESS [02:21 min]
[INFO] WKND Sites Project - UI Frontend ................... FAILURE [03:17 min]
[INFO] WKND Sites Project - Repository Structure Package .. SKIPPED
[INFO] WKND Sites Project - UI apps ....................... SKIPPED
[INFO] WKND Sites Project - UI content .................... SKIPPED
[INFO] WKND Sites Project - UI config ..................... SKIPPED
[INFO] WKND Sites Project - All ........................... SKIPPED
[INFO] WKND Sites Project - Integration Tests ............. SKIPPED
[INFO] WKND Sites Project - Dispatcher .................... SKIPPED
[INFO] WKND Sites Project - UI Tests ...................... SKIPPED
[INFO] WKND Sites Project - Project Analyser .............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10:06 min
[INFO] Finished at: 2021-03-18T01:14:42-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.6:npm (npm run prod) on project aem-guides-wknd.ui.frontend: Failed to run task: 'npm run prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [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 <args> -rf :aem-guides-wknd.ui.frontend

标签: aem

解决方案


看起来您可能会因为两个主要原因而收到此错误:

  1. 你的 npm 模块已经过时了:

解决方案:清除 node_modules,然后npm install重试。如果这不起作用,请尝试:npm install --global npm

  1. 您的操作系统与您从中获取代码的操作系统不同。

解决方案:删除文件.browserslistrc应该可以。


推荐阅读