npm install 在出现如此多的警告后给出错误

2023-11-29

我的 ReactJS 项目直到上周都运行良好,但从周日开始,它在 npm install 上出现以下错误:

PS C:\Projects\Interface\ClientApp> npm install
npm WARN deprecated [email protected]: Use @material-ui/icons instead
npm WARN deprecated [email protected]: You can now upgrade to @material-ui/core
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not
         recommended for usage due to the number of issues. Please, upgrade your
         dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core,
         this package is dedicated to the legacy v1
npm WARN deprecated [email protected]: You can now upgrade to
         @material-ui/pickers. Documentation for v2 can be found at
         https://material-ui-pickers-v2.dmtr-kovalenko.now.sh/
npm WARN deprecated [email protected]: Deprecated. Please use
         https://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could
         be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not
         recommended for usage due to the number of issues. Please, upgrade your
         dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading 
         Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: Please migrate to Workbox:
         https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+.
         Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: Please migrate to Workbox:
         https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could
         be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: This module moved to @hapi/hawk. Please make sure to
         switch over as this distribution is no longer supported and may contain
         bugs and critical security issues.
npm WARN deprecated [email protected]: request has been deprecated,
         see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade
         to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: request has been deprecated, see
         https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This is not needed anymore.
         Use `require('os').homedir()` instead.
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading
         Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only,
         flatted is its successor. npm WARN deprecated [email protected]: This version
         has been deprecated in accordance with the hapi support policy (hapi.im/support).
         Please upgrade to the latest version to get the best features, bug fixes,
         and security patches. If you are unable to upgrade at this time, paid 
         support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance
         with the hapi support policy (hapi.im/support). Please upgrade to the 
         latest version to get the best features, bug fixes, and security patches. 
         If you are unable to upgrade at this time, paid support is available for 
         older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance
         with the hapi support policy (hapi.im/support). Please upgrade to the 
         latest version to get the best features, bug fixes, and security patches. 
         If you are unable to upgrade at this time, paid support is available for 
         older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This module moved to @hapi/sntp. Please make sure 
         to switch over as this distribution is no longer supported and may contain 
         bugs and critical security issues.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...on" : "10.16.3"
npm ERR!     }'

npm ERR! A complete log of this run can be found in: npm ERR!    
C:\Users\AppData\Roaming\npm-cache\_logs\2020-07-06T10_18_35_852Z-debug.log

Note

  1. 我已将 npm 从 6.9.0 升级到 6.14.5,然后也面临同样的问题
  2. 我已经删除了 package.json.lock 和 node_modules 然后也面临同样的问题

请让我知道我还缺少什么? --------------我的package.json--------------

{
  "name": "clientapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.9.5",
    "@material-ui/icons": "^4.4.1",
    "@material-ui/lab": "^4.0.0-alpha.45",
    "@material/typography": "^3.1.0",
    "@trendmicro/react-sidenav": "^0.4.5",
    "axios": "^0.19.0",
    "bootstrap": "^3.4.1",
    "flux": "^3.1.3",
    "jquery": "^3.4.1",
    "match-sorter": "^4.0.2",
    "material-grid": "^0.1.0",
    "material-table": "^1.54.2",
    "material-ui": "^0.20.2",
    "material-ui-colors": "^1.0.0",
    "material-ui-icons": "^1.0.0-beta.36",
    "mdbreact": "^4.22.0",
    "oidc-client": "^1.5.4",
    "plotly.js": "^1.49.4",
    "prop-types": "^15.7.2",
    "react": "^16.13.0",
    "react-bootstrap": "^0.31.5",
    "react-bootstrap-tabs": "^1.0.2",
    "react-dom": "^16.13.0",
    "react-flippy": "^0.1.5",
    "react-loader-spinner": "^3.1.5",
    "react-minimal-pie-chart": "^6.0.1",
    "react-plotly.js": "^2.3.0",
    "react-redux": "^7.1.3",
    "react-redux-loading-bar": "^4.5.0",
    "react-router-bootstrap": "^0.24.4",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.0.17",
    "react-slideshow-image": "^1.4.0",
    "react-sortable-tree": "^2.7.1",
    "react-stack-grid": "^0.7.1",
    "react-stonecutter": "^0.3.10",
    "react-table": "^7.0.0-rc.15",
    "react-web-tabs": "^1.0.1",
    "redux": "^4.0.4",
    "rimraf": "^2.6.2",
    "webpack": "*"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }
}

如果您看到日志,对于旧包,它会给出警告而不是错误。错误实际上是这一行:npm ERR! Unexpected end of JSON input while parsing near '...on" : "10.16.3"

npm ERR!}'

由于您没有包含整个日志,因此我可以猜测这可能是由于引用未正确解决而导致的歧义问题!

使用管理员权限打开命令提示符/powershell/终端等。执行以下操作:-

  • sudo npm cache clean --force
  • sudo npm cache verify
  • 删除package-lock.json文件位于C:\Users\<your_username>

现在尝试从项目文件夹安装项目依赖项npm i.

注意: - 如果这不起作用,请再次遵循与上述相同的过程并卸载npm and node并重新安装它。那么它应该可以工作!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

npm install 在出现如此多的警告后给出错误 的相关文章

随机推荐

  • 如何更改模态 UIViewController 的动画样式?

    我目前正在显示这样的 UIViewController self navigationController presentModalViewController modalViewController animated YES 并像这样隐藏
  • 使用 R Markdown 在 HTML 演示文稿中建立超链接

    我希望我已经正确标记了它 我想在 R Studio 中使用 Markdown 创建 HTML 演示文稿 我想做的是创建超链接 单击后将跳转到指定页面 而不是大多数演示文稿的直线进展 例如 title Presentation output
  • 使用 getDrawingCache 时提高图像质量 - android

    我正在使用捕获我的布局视图getDrawingCache 方法并从中创建图像 代码工作正常并且生成了图像 但这里的问题是 生成的图像质量非常低 我希望生成的图像的分辨率很高 这样每当我将其设置为ImageView它不会被拉伸 这是我正在使用
  • 如何从较大的字符串中提取字符串?

    如果输出的 HTML 页面具有以下内容 使用 jQuery 如何查找 提取 Spartan 字符串 a href mytlnet logout php t e22df53bf4b5fc0a087ce48897e65ec0 b Logout
  • 在 Windows 批处理脚本中解析并存储 json 文件中的文本

    我有一个包含以下内容的 json 文件 STATUS PASS PASSRATE 96 95238 我想存储密码 以便我可以使用它附加到文件名 Check jsonextractor bat您可以使用它通过给定的点表示的对象路径从 json
  • 将生成的代码保存在“rtwbuild”中的特殊文件夹中

    我在用rtwbuild从模拟图生成 C 代码 并希望将生成的代码保存到任意目录 有什么办法可以做到吗 您可以通过 3 种不同的方式控制生成文件的文件夹 您可以在 Simulink Preferences 中设置 代码生成文件夹 选项 您可以
  • 为什么 Java 编译器作为可执行文件而不是 JVM 字节码分发?

    在答案中Java 字节码中的平台独立性 据说Java编译器在所有平台上都是相同的 我确实明白这一点 我的问题是为什么 Java 编译器作为 exe 文件 对于 Windows 分发 为什么不作为 JVM 字节码由 JRE 执行 这样就不会有
  • 如何将 Windows Phone 8.1 Silverlight 应用程序发布到 Windows Phone 商店?

    我创建了 Windows Phone 8 1 Silverlight 应用程序 但无法将其上传到 WP 商店 我想用Create App PackagesVisual Studio 2013 Professional 中提供了一个工具 但对
  • Entity Framework 6 ToString()、格式化(DateTime 格式)、查询拦截

    我没有找到在 DateTime DateTime 字段中使用 linq2sql 进行搜索的正确方法 db Items Where x gt x DateTime1 ToString Contains 2014 08 不起作用 因为在 lin
  • 如何使用纬度和经度计算距离?

    我有一个带有纬度和经度的表 Lat Longitude 40 8151 73 0455 U 36103 40 8132 73 0476 U 36103 所以我想要的是我从我的页面传递两个经度和纬度我如何使用存储过程找到最近的地方我对此没有太
  • 如何在 Swift 中保存从 UIImagePickerController 中选取的图像?

    我正在构建一个应用程序 让用户从其照片库中选择图像 我正在使用这段代码来保存它 func imagePickerController picker UIImagePickerController didFinishPickingImage
  • 捕获要在 ASP.NET 中处理的 IIS 级别错误

    我正在 IIS 7 上使用 C 开发一个 ASP NET 站点 但我希望得到一个也适用于 IIS 6 的答案 该网站的一部分功能是能够一次上传最多 5 张图像 我有一个很好的算法来调整上传的图像大小到我的最佳大小和比例 因此 我唯一真正的大
  • 使用正则表达式提取括号之间的文本

    在这样的句子中 x 阿尔法 33 贝塔 我提取一组括号内的数据作为 x 33 使用 VBA 正则表达式模式 x d 我无法直接将未括起来的数据数组提取为 x 33 使用网络资源建议进行模式 lt 这是 VBA 特定问题吗 即对其 Regex
  • Visual Studio Code - 如何向 python 路径添加多个路径?

    我正在尝试使用 Visual Studio Code 到目前为止 它看起来很棒 轻 快等 我正在尝试让我的 Python 应用程序之一运行 该应用程序使用虚拟环境 但也使用不在我的虚拟环境的站点包中的库 我知道在settings json
  • 公历到希伯来语

    如何将公历日期转换为等效的希伯来日期 另外请告诉我这些日历 因为我对此了解不多 有一个方便的类叫做NSCalendar 您可以像这样创建一个 NSCalendar gregorian NSCalendar alloc initWithCal
  • 自动 Killall 然后 Killall 9 级

    有时我想killall某个进程 但正在运行killall不起作用 因此 当我尝试再次启动该进程时 它会失败 因为前一个会话仍在运行 然后我就得无聊的跑killall 9在上面 所以为了简化我的生活 我创建了一个realkill脚本 它是这样
  • java.io.FileNotFoundException:(访问被拒绝)

    我试图读取文件夹内的文件 但是当我运行程序时它会抛出此异常 我也尝试过其他一些文件夹 它抛出相同的异常 Exception in thread main java io FileNotFoundException C backup Acce
  • Delphi 中重复直到中使用的函数 Sleep() 的奇怪行为

    我的功能是单击按钮时的反应 当我单击按钮时 它应该开始重复并写入数组中的值 并将它们显示在主窗体的标签中 问题在于功能睡眠 有一些错误或其他原因 因为当我单击按钮时 它等待了很长一段时间 然后它最终开始执行操作 但速度很快 让我们看看我的代
  • JavaScript 缩放整个 Div

    我正在寻找一个可以放大整个 div 的 JQuery 脚本 我找到了以下插件 http test dpetroff ru jquery iviewer test and 这些插件正是我需要的东西 只需用滚轮放大和缩小 但我有一个问题 我需要
  • npm install 在出现如此多的警告后给出错误

    我的 ReactJS 项目直到上周都运行良好 但从周日开始 它在 npm install 上出现以下错误 PS C Projects Interface ClientApp gt npm install npm WARN deprecate