npm安装:npm错误!位于的json响应正文无效https://registry.npmjs.org/axios 原因:JSON输入意外结束
我有一个盖茨比公文包应用程序,必须对它进行一些更新。然后从github克隆了它,并且必须安装依赖项。当我运行npm安装:npm错误!位于的json响应正文无效https://registry.npmjs.org/axios 原因:JSON输入意外结束,npm,eslint,Npm,Eslint,我有一个盖茨比公文包应用程序,必须对它进行一些更新。然后从github克隆了它,并且必须安装依赖项。当我运行npm install时,我有以下错误日志: npm WARN ERESOLVE overriding peer dependency npm WARN Found: eslint-plugin-flowtype@undefined npm WARN node_modules/eslint-plugin-flowtype npm WARN npm WARN Could not resol
npm install
时,我有以下错误日志:
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint-plugin-flowtype@undefined
npm WARN node_modules/eslint-plugin-flowtype
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint-plugin-flowtype@"3.x || 4.x" from eslint-config-react-app@5.2.1
npm WARN node_modules/eslint-config-react-app
npm WARN eslint-config-react-app@"^5.2.1" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint-plugin-react@undefined
npm WARN node_modules/eslint-plugin-react
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint-plugin-react@"7.x" from eslint-config-react-app@5.2.1
npm WARN node_modules/eslint-config-react-app
npm WARN eslint-config-react-app@"^5.2.1" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: eslint-plugin-react-hooks@undefined
npm WARN node_modules/eslint-plugin-react-hooks
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer eslint-plugin-react-hooks@"1.x || 2.x" from eslint-config-react-app@5.2.1
npm WARN node_modules/eslint-config-react-app
npm WARN eslint-config-react-app@"^5.2.1" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/graphql
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer graphql@"^14.4.1" from express-graphql@0.9.0
npm WARN node_modules/express-graphql
npm WARN express-graphql@"^0.9.0" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/gatsby-source-strapi/node_modules/graphql
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer graphql@"^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0" from express-graphql@0.6.12
npm WARN node_modules/gatsby-source-strapi/node_modules/express-graphql
npm WARN express-graphql@"^0.6.6" from gatsby@1.9.279
npm WARN node_modules/gatsby-source-strapi/node_modules/gatsby
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: graphql@undefined
npm WARN node_modules/gatsby-source-strapi/node_modules/gatsby/node_modules/graphql
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer graphql@"^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0" from graphql-relay@0.5.5
npm WARN node_modules/gatsby-source-strapi/node_modules/gatsby/node_modules/graphql-relay
npm WARN graphql-relay@"^0.5.1" from gatsby@1.9.279
npm WARN node_modules/gatsby-source-strapi/node_modules/gatsby
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/axios reason: Unexpected end of JSON input
我已使用npm cache clean--force
清除缓存,并再次运行npm install
,但仍有相同的错误
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/axios reason: Unexpected end of JSON input
如果能为我解决这个问题提供任何帮助,我将不胜感激
package.json文件
{
"name": "gatsby-starter-hello-world",
"private": true,
"description": "A simplified bare-bones starter for Gatsby",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"dependencies": {
"gatsby": "^2.21.0",
"gatsby-image": "^2.4.0",
"gatsby-plugin-react-helmet": "^3.3.1",
"gatsby-plugin-webfonts": "^1.1.3",
"gatsby-plugin-sharp": "^2.6.0",
"gatsby-plugin-sitemap": "^2.4.2",
"gatsby-source-filesystem": "^2.3.0",
"gatsby-source-strapi": "0.0.12",
"gatsby-transformer-sharp": "^2.5.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-helmet": "^6.0.0",
"react-icons": "^3.10.0",
"react-markdown": "^4.3.1"
},
"devDependencies": {
"prettier": "2.0.5"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-hello-world"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
}
}
这不是你这边的问题。这不是
package.json
的问题。在ERR
中,URLhttps://registry.npmjs.org/axios
(错误消息的最后一行)给出了一个有缺陷的JSON响应。请参见下图。JSON验证失败。他们必须解决这个问题
试着跑步
npm cache clean --force
npm cache verify
yarn
或者尝试卸载,然后重新安装
编辑:
删除节点\u模块
文件夹和锁定
文件。然后尝试运行纱线
如果您没有安装纱线
,请使用
npm i -g yarn
使用以下命令检查安装
yarn --version
addyou package.json此处我将编辑原始帖子并添加
包。json
我在运行npm cache clean--force
npm cache verify
时,我得到以下结果:``npm cache verify cache verify and compressed(~/.npm/_cacache)已验证内容:0(0字节)索引项:0在0.009s中完成```它现在安装了吗?它没有安装好,没有问题。在此处找到它-https://github.com/t-yanick/tazoh-portfolio
稍等。我正在用package.json运行warn