首页 > 解决方案 > 如何摆脱 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

完整的日志可以在这里查看

提前致谢。

标签: npmgyp

解决方案


推荐阅读