Orocommerce 作曲家安装失败

Posted

技术标签:

【中文标题】Orocommerce 作曲家安装失败【英文标题】:Orocommerce composer install failed 【发布时间】:2021-11-03 21:05:04 【问题描述】:

当我尝试安装社区版的 Orocommerce 时,我执行下一个命令:composer install --prefer-dist --no-dev 几分钟后进程停止并返回下一个错误:

npm ERR! gyp ERR! cwd <MY_PATH>/orocommerce/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.8.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/juan/.npm/_logs/2021-09-06T18_15_52_689Z-debug.log
Script Oro\Bundle\InstallerBundle\Composer\ScriptHandler::installAssets handling the install-assets event terminated with an exception


  [RuntimeException]
  Failed to install npm assets

当我检查日志时,我发现了下一个跟踪(我不知道节点日志):

4506 timing build:run:postinstall:node_modules/babel-runtime/node_modules/core-js Completed in 47ms
4507 info run node-sass@4.14.1 postinstall  code: 1, signal: null 
4508 timing reify:rollback:createSparse Completed in 2661ms
4509 timing reify:rollback:retireShallow Completed in 0ms
4510 timing command:ci Completed in 118661ms
4511 verbose stack Error: command failed
4511 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
4511 verbose stack     at ChildProcess.emit (node:events:394:28)
4511 verbose stack     at maybeClose (node:internal/child_process:1064:16)
4511 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
4512 verbose pkgid node-sass@4.14.1
4513 verbose cwd <MY_PATH>/orocommerce
4514 verbose Linux 5.10.16.3-microsoft-standard-WSL2
4515 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "ci" "--loglevel" "error"
4516 verbose node v16.8.0
4517 verbose npm  v7.21.0
4518 error code 1
4519 error path <MY_PATH>/orocommerce/node_modules/node-sass
4520 error command failed
4521 error command sh -c node scripts/build.js
4522 error Building: /usr/local/bin/node <MY_PATH>/orocommerce/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
4522 error make: Entering directory '<MY_PATH>/orocommerce/node_modules/node-sass/build'
4522 error   g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/home/juan/.node-gyp/16.8.0/include/node -I/home/juan/.node-gyp/16.8.0/src -I/home/juan/.node-gyp/16.8.0/deps/openssl/config -I/home/juan/.node-gyp/16.8.0/deps/openssl/openssl/include -I/home/juan/.node-gyp/16.8.0/deps/uv/include -I/home/juan/.node-gyp/16.8.0/deps/zlib -I/home/juan/.node-gyp/16.8.0/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++14 -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
...

执行结束:

提前感谢您的帮助。

【问题讨论】:

您尝试过什么解决问题的方法?你被困在哪里了? Y 验证所有系统要求都正常,并且文件夹具有正确的权限。我下载项目没有做任何改变。 请运行npm ci并分享输出。 输出最大:pastebin.com/RPZn25Gt 原来该应用程序与 NodeJS v16 不兼容。我们建议在修复错误之前降级到 v14 LTS 【参考方案1】:

谢谢,错误发生在 Node 16 上。使用 NodeJs 14.0 工作!

【讨论】:

以上是关于Orocommerce 作曲家安装失败的主要内容,如果未能解决你的问题,请参考以下文章

自定义捆绑迁移在首次安装时失败,因为它们在 OroCommerce 的安装程序之前运行

作曲家安装/更新失败

作曲家安装失败,返回码 1

无法看到 mysql 数据库时作曲家安装失败

laravel 安装失败

由于 symfony/flex,Composer 安装突然失败