完整解決步驟:
sudo brew uninstall node
brew update
brew upgrade
brew cleanup
brew install node
sudo chown -R eve
/usr/local/
brew link --overwrite node
brew postinstall node
node -v
修改linux權限命令:chmod
用法:chmod XXX filename
×××(所有者\組用戶\其他用戶)
×=4 讀的權限
×=2 寫的權限
×=1 執(zhí)行的權限
常用修改權限的命令:
sudo chmod 600 ××× (只有所有者有讀和寫的權限)
sudo chmod 644 ××× (所有者有讀和寫的權限,組用戶只有讀的權限)
sudo chmod 700 ××× (只有所有者有讀和寫以及執(zhí)行的權限)
sudo chmod 666 ××× (每個人都有讀和寫的權限)
sudo chmod 777 ××× (每個人都有讀和寫以及執(zhí)行的權限)
安裝npm i weex-toolkit -g出錯
npm ERR! path /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/fs-extra/node_modules/.bin/rimraf
npm ERR! code EEXIST
npm ERR! Refusing to delete /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/fs-extra/node_modules/.bin/rimraf: containing path /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/fs-extra/node_modules/rimraf isn't under npm's control
npm ERR! File exists: /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/fs-extra/node_modules/.bin/rimraf
執(zhí)行:rm rf /usr/local/lib/node_modules/weex-toolkit
然后再npm i weex-toolkit -g 成功