换电脑时环境配置常见问题及一些git设置

新电脑配置环境时的问题:

Node找不到,但重装时又提示有node 或者node报错Error: No such keg: /usr/local/Cellar/node

brew cleanup 

brew link node

brew uninstall node

brew uninstall --force node

brew install node

安装nvm命令(node版本管理工具)

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

按完重启iterm

安装N(node版本管理工具)

 $ sudo npm install -g n

brew安装命令:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Oh my zsh. git插件安装命令

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git设置别名

我们只需要敲一行命令,告诉Git,以后st就表示status:

git config --global alias.s status

git config --global alias.c commit

git config --global alias.ck checkout

git config --global alias.a add

新电脑模拟器报错No bundle URL present

appdelegate.m修改下成代码

jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.bundle?platform=ios&dev=false"];

新电脑报错单元测试报错 jest.mock() is not allowed to reference any out-of-scope variables

Node版本问题 降到v8.12.0或者v6.11.3

如果node版本切换了没有用请使用:

nvm alias default v6.11.3    来修改默认node版本

猜你喜欢

转载自blog.csdn.net/wzxxdghdf/article/details/83113845