首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >我无法安装我的项目包

我无法安装我的项目包
EN

Stack Overflow用户
提问于 2019-05-29 06:20:30
回答 1查看 49关注 0票数 1

在我的软件包中安装expressJs时出现错误。我不得不执行npm cache clean --force没有成功,然后我删除了我的node_modulespackage-lock.json,我尝试使用npm i重新安装软件包,我仍然得到一个错误。

现在,我从我的个人电脑Windows10上删除了node.js,下载并安装了最新的节点,并再次尝试重新安装项目包。现在我得到的错误是

代码语言:javascript
复制
$ npm i
npm ERR! Unexpected end of JSON input while parsing near '...ncies":{"autoprefixer'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Chioma Onyepere\AppData\Roaming\npm-cache\_logs\2019-05-28T20_26_29_676Z-debug.log

我的应用是基于nextJs构建的

这是package.json

代码语言:javascript
复制
{
  "name": "ratethis",
  "version": "1.0.2",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "dev": "next",
    "build": "next build",
    "now-build": "next build",
    "start": "next start -p %PORT%"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/infinity-web-development/ratethis"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/infinity-web-development/ratethis/issues"
  },
  "homepage": "https://github.com/infinity-web-development/ratethis#readme",
  "dependencies": {
    "@zeit/next-css": "^1.0.1",
    "antd": "^3.15.1",
    "faker": "^4.1.0",
    "next": "^8.0.3",
    "next-images": "^1.1.1",
    "next-redux-wrapper": "^3.0.0-alpha.2",
    "now": "^15.0.6",
    "prop-types": "^15.7.2",
    "react": "^16.8.5",
    "react-dom": "^16.8.5",
    "react-polls": "^1.2.0",
    "react-redux": "^7.0.1",
    "redux": "^4.0.1",
    "redux-saga": "^1.0.2",
    "shallow-equal": "^1.1.0",
    "uuid": "^3.3.2"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.1",
    "babel-plugin-import": "^1.11.0",
    "babel-plugin-inline-import": "^3.0.0",
    "eslint": "^5.16.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-standard": "^12.0.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.2.1",
    "eslint-plugin-node": "^7.0.1",
    "eslint-plugin-promise": "^4.0.1",
    "eslint-plugin-react": "^7.11.1",
    "eslint-plugin-standard": "^4.0.0",
    "next-antd-aza-less": "^1.0.2"
  }
}

显然错误来自我的pc,因为它在另一台pc上工作得很好。

EN

回答 1

Stack Overflow用户

发布于 2019-05-29 06:37:18

我不太了解npm,但我建议尝试让它验证它已经完成的安装,并以某种方式重写现有安装的package.json文件。

https://docs.npmjs.com/cli/cache.html

即使安装失败了,package.json也没有显示任何安装的痕迹,但可能有一些只有npm知道的工件在妨碍安装。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56350758

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档