我正在尝试启动一个新的 React JS 项目,当我启动服务器时出现此错误(我没有修改生成的文件)
Compiling...
/home/Dorph/comparateur-representant-web/comparator_web/node_modules/react-scripts/scripts/start.js:19
throw err;
^
[Error: ENOENT: no such file or directory, stat '/home/Dorph/.#crux.c'] {
errno: -2,
code: 'ENOENT',
syscall: 'stat',
path: '/home/Dorph/.#crux.c'
}
[Dorph@Host-002 comparator_web]$
我只执行这个命令:
npx create-react-app hello-world ; cd hello-world ; npm start
如果有人知道如何解决这个问题。
全局安装Vite(如果需要): 如果您尚未全局安装Vite,请使用以下命令: -> npm install -g create-vite
创建Vite项目: 将 my-NewReact-app 替换为您所需的项目名称。 --template react 指定使用React模板。 -> npm create vite@latest my-NewReact-app --template React
导航到项目目录: -> cd my-NewReact-app
在 VS Code 中打开项目: -> 代码.
然后打开新窗口后,使用以下语法在项目文件夹中安装依赖项: -> npm 安装
启动开发服务器: -> npm 运行开发