部署到circle-ci时发生构建错误(版本错误)

时间:2020-11-02 19:30:03

标签: reactjs eslint circleci

情况

  • 当我部署到以下版本时,我遇到该版本错误的问题 circle-ci

我已经尝试

  • 我确实删除了node_modules和packcage.lock.json并从package.json中删除了皮棉,然后手动重新安装了节点,但这无法解决问题。而不是发生其他问题。

这是我的repo

错误

        There might be a problem with the project dependency tree.
        It is likely not a bug in Create React App, but something you need to fix locally.
        
        The react-scripts package provided by Create React App requires a dependency:
        
          "eslint": "^6.6.0"
        
        Don't try to install it manually: your package manager does it automatically.
        However, a different version of eslint was detected higher up in the tree:
        
          /home/circleci/repo/node_modules/eslint (version: 7.12.1) 
        
        Manually installing incompatible versions is known to cause hard-to-debug issues.
        
        If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to a .env file in your project.
        That will permanently disable this message but you might encounter other issues.

1 个答案:

答案 0 :(得分:0)

最后,我解决了这个问题。

这个问题是我忘记卸载yarn.lock只是卸载package-lock.json

解决方法

1。删除package-lock.json和yarn.lock

2。卸载npm和yarn

3.yarn删除eslint

4.install npm

5.yarn add -D eslint

6.git push