npm ERR!在安装next.js时

时间:2019-09-24 06:51:22

标签: node.js npm eslint next.js

我遇到问题,例如尝试使用npm install --save next安装next.js,然后显示以下错误,例如

  

npm错误!解析'...:{“ eslint”:“ 3.19.0”,“'

附近时,JSON输入意外结束

我只是花了几个小时才融入其中。 我该如何解决?

package.json

{
  "name": "a-client-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "node server.js -p $PORT",
    "build": "next build",
    "start": "NODE_ENV=production node server.js -p $PORT"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.19.0",
    "express": "^4.17.1",
    "react": "^16.9.0",
    "react-dom": "^16.9.0"
  }
}

信息:

OS: Windows 10
NodeJS: 10.16.3
NPM: 6.11.3

谢谢

1 个答案:

答案 0 :(得分:1)

问题出在节点缓存上。

npm cache clean --force

解决了该问题。

在这里写答案,以防其他人碰到这个问题。 :)