我如何摆脱 gyp 错误?

问题描述

当我尝试在工作项目上运行 npm install 时,我收到了很多 gyp 错误。请注意,我的同事正在使用 mac,而我正在使用带有 WSL 的 Windows 笔记本电脑,我的 mac 还没有到货。我不确定是什么问题,但我一直没能解决这个问题。

npm ERR! path /mnt/c/Users/ever.gonzalez/work/tigo-money-web/node_modules/node-sass
npm ERR! command Failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /home/edgg72/.nvm/versions/node/v16.5.0/bin/node /mnt/c/Users/ever.gonzalez/work/tigo-money-web/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/home/edgg72/.nvm/versions/node/v16.5.0/bin/node',npm ERR! gyp verb cli   '/mnt/c/Users/ever.gonzalez/work/tigo-money-web/node_modules/node-gyp/bin/node-gyp.js',npm ERR! gyp verb cli   'rebuild',npm ERR! gyp verb cli   '--verbose',npm ERR! gyp verb cli   '--libsass_ext=',npm ERR! gyp verb cli   '--libsass_cflags=',npm ERR! gyp verb cli   '--libsass_ldflags=',npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.5.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4,please use NODEJS_ORG_MIRROR
npm ERR! gyp verb download using dist-url https://nodejs.org/dist
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` Failed Error: not found: python2

可以查看完整日志here

提前致谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)