我试图安装一些magento店面应用程序,需要linux在WSL上运行。我设法让大多数东西工作,但最后我在试图安装依赖关系卡住了。当它试图安装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并重新安装应该可以解决这个问题,但它对我的情况没有帮助。如果有人知道这里有什么奇怪的地方,我将非常感谢一些帮助。
1条答案
按热度按时间vwkv1x7d1#
我找到了解决方案。显然GYP在最新版本的Node(16)上有问题。我不得不降级到Node 14,然后它就正常工作了。