修正: ERROR in Plugin 'react' was conflicted between 'package.json' and 'eslint-config-react-app'

使用pnpm用cra生成了react app,在發布成github page時遭遇以下問題

ERROR in Plugin 'react' was conflicted between 'package.json' and 'eslint-config-react-app'

參照文章 How to Fix ERROR in Plugin 'react' was conflicted between 'package.json' and 'eslint-config-react-app'?

就結論來說,就是我混用了pnpm和npm的指令導致這個問題

  1. 確認使用的指令
    發現gh-pages建議指令要調整

  2. 清除node_modeules目錄
    rm -rf node_modeules

  3. 移除lock file
    rm*-lock*.*

  4. 重新安裝套件
    pnpm install

  5. 部屬
    pnpm run deploy


留言