reactjs npm运行dev不打开端口

fbcarpbf  于 2023-02-15  发布在  React
关注(0)|答案(1)|浏览(129)

我尝试用react-vite创建一个项目,我按照vite网站上的文档中描述的步骤操作,当我运行“npm run dev”命令时,它没有打开任何端口,并且返回到命令行,没有显示错误。
stays like this
here is an image of a project created by a friend running on this same pc with the result I expected

qni6mghb

qni6mghb1#

你必须把这个添加到你的package.json中

"scripts": {
    "start": "react-scripts start",
    "dev": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

这应该是有帮助的,如果你正在使用react,如果你需要其他的东西,只要问

相关问题