我正在尝试在我的 MAC OS 机器中设置 SAP Commerce Cloud v2105 项目以进行 Spartacus 开发。我正在使用本指南:https ://sap.github.io/spartacus-docs/installing-sap-commerce-cloud-2105/
到目前为止,我已经安装了先决条件:
JDK 11 => 很快将其更改为 SAP Machine JDK 11,基于:SAP Commerce Cloud with Spartacus 安装错误
NodeJS 版本 12
Angular CLI 版本 10
Setup JAVA_HOME
一切都很顺利,直到我在运行命令时收到此错误:
./install.sh -r cx-for-spa initialize
错误
> Task :recipes:cx-for-spa:buildSystem FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/programmer/Documents/projects/commercloud/installer/recipes/cx-for-spa/build.gradle' line: 604
* What went wrong:
Execution failed for task ':recipes:cx-for-spa:buildSystem'.
> external process returned non-zero exit code, command: [sh, -c, export PLATFORM_HOME="/Users/programmer/Documents/projects/commercloud/hybris/bin/platform" && export ANT_OPTS="-Xmx1024m -Dfile.encoding=UTF-8" && export ANT_HOME="/Users/programmer/Documents/projects/commercloud/hybris/bin/platform/apache-ant" && chmod +x "/Users/programmer/Documents/projects/commercloud/hybris/bin/platform/apache-ant/bin/ant" && export PATH="$ANT_HOME/bin:$PATH" && ant clean all]
堆栈跟踪
[exec]
[exec]
[exec] Running "pnpm install" in /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp
[exec]
[exec]
[exec] The command failed:
[exec] /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp/pnpm-local/node_modules/.bin/pnpm install --no-prefer-frozen-lockfile --strict-peer-dependencies
[exec] ERROR: Error: The command failed with exit code 127
[exec]
[exec] Trying again (attempt #2)...
[exec]
[exec] Deleting the "node_modules" folder
[exec]
[exec] The command failed:
[exec] /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp/pnpm-local/node_modules/.bin/pnpm install --no-prefer-frozen-lockfile --strict-peer-dependencies
[exec] ERROR: Error: The command failed with exit code 127
[exec]
[exec] Trying again (attempt #3)...
[exec]
[exec] Deleting the "node_modules" folder
[exec]
[exec] The command failed:
[exec] /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp/pnpm-local/node_modules/.bin/pnpm install --no-prefer-frozen-lockfile --strict-peer-dependencies
[exec] ERROR: Error: The command failed with exit code 127
[exec]
[exec] /bin/sh: /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp/pnpm-local/node_modules/.bin/pnpm: No such file or directory
[exec] /bin/sh: /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp/pnpm-local/node_modules/.bin/pnpm: No such file or directory
[exec] /bin/sh: /Users/programmer/Documents/projects/commercloud/hybris/bin/modules/smartedit/smartedittools/common/temp/pnpm-local/node_modules/.bin/pnpm: No such file or directory
[exec] Giving up after 3 attempts
[exec]
[exec]
[exec] ERROR: The command failed with exit code 127
[exec]
我试图远
解决方案 #1 - 删除 NodeJS 和 NPM 并重做所有内容
参考:https ://answers.sap.com/questions/12762725/hybris-63-sapaomsomb2bb2c-ant-clean-all-error.html?childToView=12794099 -没有工作
解决方案 #2 - 手动删除 pnpm 目录上的 node_modules,但只找到快捷方式,没有找到 node_modules 文件夹
解决方案 #3 - 重新安装 Angular CLI -不工作
解决方案 #4 - 此解决方案 => SAP Commerce Cloud with Spartacus 安装错误-
解决方案 #5 无效 - 在 build.gradle 文件中注释掉所有与smartedit相关的
扩展-无效
解决方案 #6 - 卸载 Visual Studio 代码,因为它可能会导致冲突 -不起作用
解决方案 #7 - 评论了构建并行标志
参考:构建失败。步骤 2:构建并初始化新配方。初始化系统-不工作
只是在这里问,可能会有人遇到同样的问题。