加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

error [email?protected]: The engine "node" i

发布时间:2020-12-15 20:34:33 所属栏目:百科 来源:网络整理
导读:初始化 react项目时报错: error [email?protected]: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || =9.10.0". Got "8.9.4" error Found incompatible module info Visit https://yarnpkg.com/en/docs/cli/

初始化 react项目时报错:

error [email?protected]: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "8.9.4"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

这是node版本不兼容导致的,升级node版本可以解决,不升级也可以解决,用下面的命令:

npx create-react-app my-app  --use-npm

  

官方issues:https://github.com/facebook/create-react-app/issues/5714 和?https://github.com/facebook/create-react-app/issues/3974

问题:

Guys,a few days ago,I installed `yarn` on my Mac just because it‘s necessary for a project where I‘m involved.

My problem is that,now,when I create a new app with `CRA`,it‘s going to use `yarn` instead of `npm`. And,to be honest,I prefer `npm`.

Is there a way to force to use `npm` instead of `yarn`?
Or should I wait until finish the initial setup,then remove the `yarn.lock` file,the `node_modules` folder and then run `npm i`?

答案:

You can run CRA with `--use-npm` flag to force it to use npm.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读