简体   繁体   English

我不能同时使用 npm 和纱线启动带有反应脚本的服务器?

[英]I can not start a server with react scripts using both npm and yarn?

I tried literally everything, removing node_modules dozens of times, removing webpack-dev-server and all webpack packages , tried both npm and yarn , downgrading react-scripts and still the problem exist, i can not start a server in my project folder.我几乎尝试了一切,删除了 node_modules数十次,删除了 webpack-dev-server 和所有 webpack 包,尝试了npm 和 yarn降级 react-scripts仍然存在问题,我无法在我的项目文件夹中启动服务器。 this is my package.json file:这是我的 package.json 文件:

{
  "name": "test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "react": "^16.11.0",
    "react-dom": "^16.11.0",
    "react-scripts": "^3.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "test": "react-scripts test"
  }
}

And i get that error always: error Command failed with exit code 1.我总是得到那个错误: error Command failed with exit code 1.

What can be wrong in my project folder, why server can not be started??我的项目文件夹中可能有什么问题,为什么无法启动服务器?

Which environment do you have?你有什么环境? You can try this and this你可以试试这个这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM