---
# System prepended metadata

title: Init vue project
tags: [vue]

---

# Init vue project
###### tags: `vue`


### 在 OS X 中如果執行安裝指令之後出現 nvm: command not found，表示你的系統中沒有 .bash_profile 這個檔案。可以透過 touch ~/.bash_profile 建立一個檔案，然後再執行一次安裝指令。
```gherkin=
 touch ~/.bash_profile
```

# download nvm
```gherkin=
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
```

# 如果是 zsh 跑要重新讀一下 config 
```gherkin=
source ~/.zshrc 
```

```gherkin=
# Download and install a <version>
nvm install v14.9.0<version>      
# Modify PATH to use <version>
nvm use v14.9.0        
# List versions (installed versions are blue)
nvm ls                     
```

install nvm & node
> https://medium.com/@toumasaya/node-js-%E7%92%B0%E5%A2%83%E8%A8%AD%E5%AE%9A-for-mac-a2628836feaf

Mac OS npm install with error: `gyp` failed with exit code: 1
> https://stackoverflow.com/questions/49348482/npm-install-with-error-gyp-failed-with-exit-code-1



### 安裝 vue-cli 在 command line 介面中執行：
```gherkin=
npm install -g vue-cli
```
### 安裝 webpack 在 command line 介面中執行：
```gherkin=
vue init webpack your-project-name
```
