問題描述
將node版本升級到 v10.5.0
后袒啼,yarn install
無法正常執(zhí)行。
錯誤提示如下
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/youthcity/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command \"/Users/youthcity/.nvm/versions/node/v10.5.0/bin/node\" \"/Users/youthcity/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64\"
gyp ERR! cwd /Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/youthcity/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command \"/Users/youthcity/.nvm/versions/node/v10.5.0/bin/node\" \"/Users/youthcity/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64\"
gyp ERR! cwd /Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/youthcity/.nvm/versions/node/v10.5.0/bin/node /Users/youthcity/.nvm/versions/node/v10.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Darwin 16.7.0
node-pre-gyp ERR! command \"/Users/youthcity/.nvm/versions/node/v10.5.0/bin/node\" \"/Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/youthcity/Documents/github/Tiger/Tiger/node_modules/fsevents
node-pre-gyp ERR! node -v v10.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
解決辦法
將node版本回退到 8.x.x
LTS 版。
例如,若使用 nvm
管理node版本佃扼,可使用命令
nvm install v8.11.3 # 下載node
nvm alias default 8.11.3 #將 8.11.3版本設(shè)為默認版本
重啟終端,重新進行 yarn install
即可蔼夜。
其他問題
問題描述
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
錯誤原因
Xcode
重命名后兼耀,xcodebuild
找不到原來的Xcode
。所以求冷,我們重新設(shè)置 Xcode
的路徑瘤运。
解決辦法
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer