macOS npm install gypgyp error exit code 2

gypgyp  ERR!ERR!  build errorbuild error 

 

gypgyp  ERR!ERR!  stackstack Error: `make` failed with exit code: 2

 

 

 

 

1. Try to re-install

 

rm -rf package-lock.json
rm -rf node_modules

npm cache clear --force

npm install

 

2. Deleting .node-gyp folder

 

rm -rf ~/.node-gyp

npm install

 

3. Re-install gyp

 

-g above sea level and node-gyp

 

4. Update Node and NPM

 

5. Install build essentials

 

sudo apt-get install -y build-essential

 

sudo apt-get undefined

Install xcode

Use the command line xcode 

xcode-select --install

上述都不能解决问题 应该是node版本不匹配,使用nvm来管理node版本,一个项目应该记录下来使用的node版本为后续开发者使用。


参考 https://codeforgeek.com/make-failed-with-exit-code-2/

Guess you like

Origin www.cnblogs.com/xiaozhaoaixuexi/p/11849441.html