在执行sudo npm install -g react-native-cli 命令时候,报错
npm
ERR!
Darwin 15.5.0
npm
ERR!
argv
“/usr/local/Cellar/node/5.7.0/bin/node” “/usr/local/bin/npm” “install” “-g” “react-native-cli”
npm
ERR!
node
v5.7.0
npm
ERR!
npm
v3.6.0
npm
ERR!
path
/usr/local/lib/node_modules/react-native-cli
npm
ERR!
code
ENOTEMPTY
npm
ERR!
errno
-66
npm
ERR!
syscall
rename
npm
ERR!
ENOTEMPTY: directory not empty, rename ‘/usr/local/lib/node_modules/react-native-cli’ -> ‘/usr/local/lib/node_modules/.react-native-cli.DELETE’
npm
ERR!
npm
ERR!
If you need help, you may report this error at:
npm
ERR!
<https://github.com/npm/npm/issues>
npm
ERR!
Please include the following file with any support request:
npm
ERR!
/Users/xxx/Documents/reactnative/sourcecode/npm-debug.log
解决办法:
显示系统隐藏文件
defaults write com.apple.finder AppleShowAllFiles -bool true
删除’/usr/local/lib/node_modules/.react-native-cli.DELETE’该文件