magento - 尝试在 WSL 上安装带有 node-sass 的应用程序。获取 "gyp ERR! stack Error: ` make` 失败,退出代码为 : 2"

标签 magento windows-subsystem-for-linux node-gyp node-sass

我试图安装一些需要 Linux 在 WSL 上运行的 magento 店面应用程序。我设法让大多数事情正常工作,但最终我坚持尝试安装依赖项。当它尝试安装 node-sass 时,我收到此错误:

    make: Leaving directory '/mnt/c/Github/psp-storefront-magento2/node_modules/node-sass/build'
make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/mnt/c/Github/psp-storefront-magento2/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Linux 4.4.0-19041-Microsoft
gyp ERR! command "/home/lursmani/.nvm/versions/node/v16.10.0/bin/node" "/mnt/c/Github/psp-storefront-magento2/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /mnt/c/Github/psp-storefront-magento2/node_modules/node-sass
gyp ERR! node -v v16.10.0

我读到删除yarn.lock并再次安装应该可以解决这个问题,但它对我的情况没有帮助。如果有人知道这里有什么时髦的,我将不胜感激。

最佳答案

我找到了解决方案。显然,GYP 在最新版本的 Node (16) 上存在问题。我必须降级到 Node 14,然后它才能正常工作。

关于magento - 尝试在 WSL 上安装带有 node-sass 的应用程序。获取 "gyp ERR! stack Error: ` make` 失败,退出代码为 : 2",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69483159/

相关文章:

mysql - Windows上的WSL连接到MySQL Server 8无效

node.js - 如何在 npm install 中使用预安装的二进制文件(zeromq)而不是使用 node-gyp 工具构建?

node.js - node-gyp 错误找不到模块 '/node_modules/node-gyp/bin/node-gyp.js'

javascript - Magento:客户对订单页面的评论必填字段

c++ - 如何在 Visual Studio 中为 Cmake 项目添加 Linux 编译

php - Magento Staging - 仅首页显示

windows - WSL2 的 MongoDB Compass 问题

node.js - Node -gyp。 MSBuild.exe` 失败,退出代码 : 1

api - Magento批量更新属性

magento 2.3 安装后黑屏