下載nvm
brew install nvm
編輯nvm命令
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
下載node
nvm install v8.9.1
切換版本
nvm use v8.9.1
刪除原本的node-gyp
rm?-rf?~/.node-gyp/??
下載對(duì)應(yīng)版本的node-gyp
npm?install?-g?node-gyp??
刪除原本的node_modules
rm?-rf?項(xiàng)目地址/node_modules?
到項(xiàng)目根目錄下載新的node_modules
npm install