/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
这里如果执行报错:
Failed to connect to raw.githubusercontent.com port 443: Connection refused
原因是https://raw.githubusercontent.com这个域名被国内和谐了,但是我们可以通过真实ip来进行访问。
sudo vim /etc/hosts
199.232.68.133 raw.githubusercontent.com
如果仍然报错:
remote: Enumerating objects: 49, done.
remote: Counting objects: 100% (49/49), done.
remote: Compressing objects: 100% (49/49), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch origin --force
我们可以先ping一下github.com看看是否通,如果不通则同上述处理,只不过这次使用github.com的真实域名。
如果还是不行的话,也别费那个劲了,直接跳过这步,使用下面手动安装就行了。
两种方式自己选择
brew install nodejs
sudo chmod -R 777 /usr/local/lib/node_modules/
npm -v
node -v
npm i -g vue
npm install -g vue-cli
npm install -g webpack
vue init webpack myvue
vue开发工具有很多,对比就不在这说了,这里以vscode为例。
——————————————————————————————————
创建vue第一个程序hello word!