下載react repo 出現npm i 錯誤 > <


Posted by mijouhsieh on 2023-05-03

在終端機以指令下載 github 上的repo
git clone https://github.com/ALPHACamp/todolist-react-starter.git
進入專案資料夾
npm i 安裝出現Error
git-npm-i-error1
git-npm-i-error-2package-lock-json
出現一些node.module裡版本已棄用的錯誤
有試過終端機 給的 npm audit fix npm audit

這篇 解决npm安装时出现run npm audit fix

無解 > < 嗚嗚


重新刪除node.module
進入 專案資料夾後操作以下指令:
rm -rf node_modules
git reset package-lock.json
npm install
npm start

顯示 專案中的依賴樹有問題 (ಠ_ಠ)
有error 這篇也有一樣的問題

也有出現 Error: error:0308010C:digital envelope routines::unsupported
這個錯誤會出現在要執行React app的時候
看到一篇關於修正此error的方法


後來 有同學說不用刪掉node_modules和package-lock.json
npm i react-scripts@5.0.1


想說之前 npm i 直接安裝會有error
所以
重新clone專案
cd專案
npm i react-scripts@5.0.1
npm i
npm i react-scripts@5.0.1
npm start
就可以自動開啟瀏覽器 localhost:3000


以下是終端機顯示畫面
git-npm-i-react-scripts
git-npm-i-react-scriptsII
success-npm-start

不太清楚原因,先暫時擱著


#git-clone-react-repo-Error







Related Posts

用 Python 自學資料科學與機器學習入門實戰:Pandas 基礎入門

用 Python 自學資料科學與機器學習入門實戰:Pandas 基礎入門

JS-[Ajax篇]-callback hell 回呼地獄

JS-[Ajax篇]-callback hell 回呼地獄

【筆記】Command Line 入門筆記

【筆記】Command Line 入門筆記


Comments