简体   繁体   English

我无法安装我的项目套件

[英]I am unable to install my project packages

I was getting error installing expressJs to my packages. 在将expressJs安装到我的软件包时出现错误。 I have had to do an npm cache clean --force no sucess, then I deleted my node_modules and package-lock.json , I try to reinstall packages using npm i I still got an error. 我不得不做一个npm cache clean --force no成功,然后删除了我的node_modulespackage-lock.json ,我尝试使用npm i重新安装软件包,但仍然出现错误。

Now I deleted node.js from my pc windows 10 and downloaded and installed the latest node and tried to reinstall the project packages again. 现在,我从PC Windows 10中删除了node.js ,下载并安装了最新的节点,然后尝试重新安装项目包。 Now the error I get is this 现在我得到的错误是

$ 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

My app is built on nextJs 我的应用程序基于nextJs

Here's the package.json 这是package.json

{
  "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"
  }
}

Apparently error is from my pc cause it works just fine on another pc. 显然是我的电脑出现了错误,原因是它在另一台电脑上工作正常。

I don't know much about npm, but I'd suggesting trying to have it verify the installs it's already done and somehow rewrite the package.json file from the existing installs. 我对npm不太了解,但是我建议尝试让它验证已经完成的安装,并以某种方式从现有安装中重写package.json文件。

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

Even though the install failed and the package.json doesn't show any traces of the install, there could be some artifact that only npm knows about that's getting in the way. 即使安装失败并且package.json没有显示安装的任何痕迹,也可能只有npm知道某些工件妨碍了安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我在 nodeJS 中将代码作为 python shell 运行时,如何永久安装 python 包? - How can I install python packages permanently when I am running my code as a python shell in nodeJS? 为什么我无法 map 我在 React 项目中的数据? - Why am I unable to map my data in React project? 在我的项目(随机报价生成器)中。 我无法排序问题? - In my Project (Random quote generator). I am unable to sort issue? 当我尝试使用npm我安装我的项目包时出现错误 - I get an error when I try to install my project packages with npm i 我在尝试使用 npm 安装为我的克隆项目下载包时遇到错误 - i am having error trying to use npm install to download a packages for my cloned projects 我试图在我的 react 项目中安装一些包,但我得到了这个“发现 1 个低严重性漏洞”, - i was trying to install some packages to my react project i got this “ found 1 low severity vulnerability” , 无法在 Mac 上的 Visual Studio Code 中为项目安装 NPM 包 - Unable to install NPM packages for project in Visual Studio Code on Mac 我正在使用 react 无法安装 firebase - I am using react and unable to install firebase 新建项目时是否应该安装所有 npm 包? - Should I install all the npm packages when making a new project? 我无法重构我的代码以实现可重用性 - I am unable to refactor my code for reusability
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM