【问题标题】:Trying to install an app with node-sass on WSL. Getting "gyp ERR! stack Error: `make` failed with exit code: 2"尝试在 WSL 上安装带有 node-sass 的应用程序。获取“gyp ERR!堆栈错误:`make`失败,退出代码:2”
【发布时间】:2021-10-07 14:43:59
【问题描述】:

我试图安装一些需要 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 并再次安装应该可以解决此问题,但在我的情况下并没有帮助。如果有人知道这里有什么时髦的话,将不胜感激。

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2020-01-23
      • 2023-01-19
      • 1970-01-01
      • 1970-01-01
      • 2021-06-26
      • 1970-01-01
      • 1970-01-01
      • 2021-08-15
      • 1970-01-01
      相关资源
      最近更新 更多