美文网首页
create-react-app,npm start 失败,ba

create-react-app,npm start 失败,ba

作者: fhclk | 来源:发表于2019-05-09 10:18 被阅读0次

问题

The react-scripts package provided by Create React App requires a dependency:

  "babel-jest": "23.6.0"

Don't try to install it manually: your package manager does it automatically.

However, a different version of babel-jest was detected higher up in the tree:

  /home/karan/workspace/node_modules/babel-jest (version: 22.4.4)

解决方法

1. 删除yarn.lock和node-modules

2. 修改package.json,添加

"resolutions": {

    "jest": "23.6.0",

    "babel-jest": "23.6.0"

},

3. npm install

4. npm start

可参考 https://yarnpkg.com/lang/en/docs/selective-version-resolutions/

相关文章

网友评论

      本文标题:create-react-app,npm start 失败,ba

      本文链接:https://www.haomeiwen.com/subject/aivioqtx.html