javascript - 在 React.js 项目中启动本地主机服务器时出现 npm start 错误
问题描述
在 npm start 上出现此错误
'设备' 不是内部或外部命令、可运行程序或批处理文件。内部/模块/cjs/loader.js:983
抛出错误;^错误:在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15) 处找不到模块“C:\Users\Home\Desktop\react-scripts\bin\react-scripts.js” .Module._load (internal/modules/cjs/loader.js:862:27) 在 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) 在 internal/main/run_main_module.js:18 :47 {代码:'MODULE_NOT_FOUND',requireStack:[]}
解决方案
删除 node_modules 目录
删除 package-lock.json 文件
运行 npm 安装
运行 npm start
推荐阅读
- c# - 删除子记录时如何将外键值设置为 Null EF Core
- c# - 如何访问在 startup.cs 中定义的 program.cs 中的单例服务
- extjs - 如何在使用其参考选择的按钮上触发事件
- c++ - 在 Visual Studio 2019 的 linux 项目的链接器中设置静态库 (libconfig.a) 的路径
- node.js - 与 Sapper 兼容的设置,可从单个 Express/Polka 入口点为多个应用程序提供服务
- c# - 如何使用反射动态传递表名
- java - 与 ProcessBuilder 一起更改环境变量的问题
- reactjs - React-testing-library 用产生警告
- c# - 如何使用带有 OData 的 Automapper Queryable 扩展,嵌套 $select
- r - 我们如何检测在 R 中具有不同结果的观察结果?