简体   繁体   English

当我尝试使用npm我安装我的项目包时出现错误

[英]I get an error when I try to install my project packages with npm i

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

I had to delete all of npm-cache directly from my windows 10 pc, from %AppData%, ie ~/AppData\\Roaming\\npm-cache . 我必须直接从Windows 10 pc的%AppData%中删除所有npm-cache ,即~/AppData\\Roaming\\npm-cache Everything works fine now. 现在一切正常。

暂无
暂无

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

相关问题 新建项目时是否应该安装所有 npm 包? - Should I install all the npm packages when making a new project? 当我尝试使用 npm 安装 Brain.js 时出现此错误 - I get this error when I try to install brain.js using npm 我无法安装我的项目套件 - I am unable to install my project packages 为什么运行npm install时会得到很多软件包? - Why do I get a lot of packages when I run`npm install`? 每当我尝试在 Visual Studio 代码上运行“npm install”时出现错误 - I get an error whenever i try to run "npm install" on visual studio code 我在尝试使用 npm 安装为我的克隆项目下载包时遇到错误 - i am having error trying to use npm install to download a packages for my cloned projects 当我尝试在我的 React 项目中获取数据时,我收到此错误: Uncaught (in promise) SyntaxError: Unexpected token &lt; in JSON at position 0 - When i try to fetch data in my React project, then I get this error: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 当我运行“npm install”命令时,没有安装任何东西,我在终端中得到一个空的新行 - When I run "npm install" commands nothing installs and I get an empty new line in my terminal 当我运行“npm install”时,我的终端上出现此错误消息“npm ERR。Linux 5.4.72-microsoft-standard-WSL2” - I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install" 我用 create-react-app 创建了一个项目。 在我的 windows 电脑上,但当我尝试在命令行上运行 npm 时,它显示了这个错误。请帮助我 - I created a project with create-react-app. on my windows pc but when is try to run npm start on the command line it shows this error.please help me
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM