benson00077 / react-blog-practice

🥷
0 stars 0 forks source link

[紀錄] 關於 nvm 設定 #1

Open benson00077 opened 2 years ago

benson00077 commented 2 years ago

因為把 zsh 改成 oh-my-zsh,所以可能 nvm 設定跑掉。按照之前筆記設定,新增設定到~/.zshrc之後再輸入. ~/.zshrc就可以了(等同source ~/.zshrc)

新增的設定如下

## nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
benson00077 commented 2 years ago

Ctrl + Shift + . → show/hide all file in finder(MacOS)

benson00077 commented 2 years ago

然後一直遇到以下問題~不確定是不是之前沒透過 nvm 下載的 node 沒刪乾淨,然後抓到這個 node 的 cra

Error while creating new React app ("You are running create-react-app 4.0.3, which is behind the latest release (5.0.0)")

按照這篇解答,刪除後就可以成功執行 npx create-react-app