npm ERR! premature close when using npm install

删除回忆录丶 提交于 2020-02-02 04:06:27

问题


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

The log file attached is

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 ]

回答1:


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

npm install some/package

will fail with:

npm ERR! premature close

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


来源:https://stackoverflow.com/questions/56118038/npm-err-premature-close-when-using-npm-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!