React錯誤:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined


問題

  1. 運行一個剛git clone下來並cnpm install后,React應用:yarn start時,
  2. 報錯:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
  3. 只需要把【react-scripts】升級到【"^3.4.0"】即可

解決:

  1. 在【package.json】中,把【"react-scripts": "^3.x.x"】 替換為【"react-scripts": "^3.4.0"】
  2. 刪除【node_modules】文件夾
  3. 執行npm install或者 yarn install重新安裝依賴包


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM