npm ERR!使用npm install时过早关闭 [英] npm ERR! premature close when using npm install

查看:510
本文介绍了npm ERR!使用npm install时过早关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取[..................]/rollbackFailed可选:从github安装时的动词npm-session 5d754927a47910d2.

Getting [..................] / rollbackFailedOptional: verb npm-session 5d754927a47910d2 on installing from github.

尝试了多种操作,例如清理缓存,重置代理等,但是它们都不起作用.

Tried multiple things like cleaning cache, resetting proxy, etc but none of them work.

sudo npm install --save github:saarthak-jain/Blockchainbois-Voting

sudo npm install --save github:saarthak-jain/Blockchainbois-Voting

附件的日志文件为

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'saarthak-jain/Blockchainbois-Voting'
1 verbose cli ]
2 info using npm@6.9.0
3 info using node@v12.2.0
4 verbose npm-session 5d754927a47910d2
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for github:saarthak-jain/Blockchainbois-Voting premature close
8 timing stage:rollbackFailedOptional Completed in 0ms
9 timing stage:runTopLevelLifecycles Completed in 7432ms
10 verbose stack Error: premature close
10 verbose stack     at PassThrough.onclose (/usr/local/lib/node_modules/npm/node_modules/end-of-stream/index.js:47:67)
10 verbose stack     at PassThrough.emit (events.js:201:15)
10 verbose stack     at emitCloseNT (internal/streams/destroy.js:68:8)
10 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:9)
11 verbose cwd /home/saarthak/FrontEnd
12 verbose Linux 4.18.0-18-generic
13 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "saarthak-jain/Blockchainbois-Voting"
14 verbose node v12.2.0
15 verbose npm  v6.9.0
16 error premature close
17 verbose exit [ 1, true ]

推荐答案

如果有人出于与我相同的原因来到这里,我将回答"这个问题.

I'm going to "answer" this in case anyone gets here for the same reason I did.

npm install some/package

将失败,并显示:

npm ERR! premature close

如果"some/package"实际上不存在.请检查确保您的包裹名称上的拼写正确.

if "some/package" does not actually exist. Check to make sure you have the correct spelling on your package name.

为了娱乐,我应该使用:

For your entertainment, I was supposed to be using:

composer require some/package

这篇关于npm ERR!使用npm install时过早关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆