[英]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_modules
和package-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.