当前位置: 首页 > 知识库问答 >
问题:

启动时npm启动失败

颛孙正谊
2023-03-14

从文件夹内部执行“npm start”命令时出现以下错误/


    react-scripts start


    There might be a problem with the project dependency tree.
    It is likely not a bug in Create React App, but something you need to fix locally.

    The react-scripts package provided by Create React App requires a dependency:

      "webpack": "4.44.2"

    Don't try to install it manually: your package manager does it automatically.
    However, a different version of webpack was detected higher up in the tree:

      /Users/vishal/node_modules/webpack (version: 4.44.1) 

    Manually installing incompatible versions is known to cause hard-to-debug issues.

    If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
    That will permanently disable this message but you might encounter other issues.

    To fix the dependency tree, try following the steps below in the exact order:

      1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
      2. Delete node_modules in your project folder.
      3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
      4. Run npm install or yarn, depending on the package manager you use.

    In most cases, this should be enough to fix the problem.
    If this has not helped, there are a few other things you can try:

      5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
         This may help because npm has known issues with package hoisting which may get resolved in future versions.

      6. Check if /Users/vishal/node_modules/webpack is outside your project directory.
         For example, you might have accidentally installed something in your home folder.

      7. Try running npm ls webpack in your project folder.
         This will tell you which other package (apart from the expected react-scripts) installed webpack.

    If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
    That would permanently disable this preflight check in case you want to proceed anyway.

    P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! test1@0.1.0 start: `react-scripts start`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the test1@0.1.0 start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/vishal/.npm/_logs/2020-11-27T20_44_30_593Z-debug.log

我在互联网上尝试了多种解决方案,但都无效。

共有1个答案

蔚弘量
2023-03-14

试图从控制台消息中找到解决方案

添加SKIP_PREFLIGHT_CHECK=true到. env文件以绕过检查,最后不得不跳过检查。

 类似资料:
  • 我发现了这个,结果是windows 10上的pm2问题。 那篇文章末尾建议的变通办法似乎很管用。 基本上,首先安装node-cmd,然后创建一个startscript.js:

  • 当我运行这个错误时,请帮助我解决这个问题 启动应用程序上下文时出错。要显示条件,请报告启用“调试”后重新运行应用程序。2019-02-11 10:53:55.839错误8804 --- [ restartedMain]o. s. b. d.日志失败分析记者: 应用程序启动失败 说明: com中的字段userDao。实例Spring Security应用程序编程接口。服务UserServiceImp

  • 我正试图在设备上启动我的应用程序。它正在模拟器上成功发射。 null null 会不会是带有代码签名的东西? 目前我已将其设置为“不编码签名”

  • 问题内容: 尝试使用npm start命令调试节点应用程序时收到此错误。 错误: npm ERR!Windows_NT 6.3.9600 npm错误!argv“ C:\ Program Files \ nodejs \\ node.exe”“ C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm- cli.js”“开始” n​​pm

  • 我通过pgAdmin III与远程postgres-9.3连接。关闭pgAdmin后,我尝试在另一天与同一数据库连接。 在pgstartup.log文件中,我有: pg_hba.conf: 服务器上的操作系统是CentOS。不幸的是,我不知道postgres是如何安装在服务器上的,因为有人这样做了。我能用这个做什么?

  • 当前的java版本是