简体   繁体   English

无法使用“npm install”安装任何东西

[英]Can't install anything using “npm install”

I updated my node.js installation since it was very outdated but now I'm stuck with npm install not working.我更新了我的 node.js 安装,因为它已经过时了,但现在我被npm install困住了。
It starts doing it's thing but aborts about 30% into the installation on any package I've tried.它开始做它的事情,但在我尝试过的任何软件包上的安装中中止了大约 30%。
I have no more ideas on what to do since I tried reinstalling node and updating hit with no success.自从我尝试重新安装节点并更新命中后,我对该怎么做没有更多想法。

Here's an output of npm install --verbose -https://gist.github.com/friiks/ad4fd4f02e8cc60740c369c45524343d这是npm install --verbose -https://gist.github.com/friiks/ad4fd4f02e8cc60740c369c45524343d

and here's the package.json I'm using这是我正在使用的package.json

{
  "name": "projectname",
  "version": "0.0.1",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "<git url>"
  },
  "author": "Pankucins",
  "license": "ISC",
  "bugs": {
    "url": "<git url>/issues"
  },
  "homepage": "<git url>#readme",
  "dependencies": {
    "express": "^4.13.4",
    "socket.io-p2p": "^2.2.0"
  }
}

edit编辑

npm install express --save doesn't work as well, in any folder I've tried. npm install express --save在我尝试过的任何文件夹中都不起作用。

edit #2编辑 #2

Ok, I'm pretty sure it's git that causes the problem.好的,我很确定是 git 导致了问题。 I'm using cmder to do my console stuff in and this is what I see before npm stops.我正在使用 cmder 在控制台中执行操作,这就是我在 npm 停止之前看到的内容。
First - http://i.imgur.com/DOFh00k.png首先 - http://i.imgur.com/DOFh00k.png
Then - http://i.imgur.com/6O5BN13.png然后 - http://i.imgur.com/6O5BN13.png
And after that it crashes.在那之后它崩溃了。 FYI this is how the console looks after the crash when I don't redirect the output to a file - http://i.imgur.com/LY4K5qV.png仅供参考,这是当我不将输出重定向到文件时控制台在崩溃后的样子 - http://i.imgur.com/LY4K5qV.png

Thanks in advance提前致谢

This solved the issue for me.为我解决了这个问题。 I had set my npm to target somewhere else than http://registry.npmjs.org/ .我已经将我的 npm 设置为http://registry.npmjs.org/以外的其他地方。

Hope this helps to others!希望这对其他人有帮助!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM