github - npm 错误!使用 npm install 时过早关闭

标签 github npm npm-install

在从 github 安装时获取 [.................]/rollbackFailedOptional:动词 npm-session 5d754927a47910d2。

尝试了多种方法,例如清理缓存、重置代理等,但都不起作用。

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 ]

最佳答案

如果有人出于同样的原因来到这里,我将“回答”这个问题。

npm install some/package

将失败:
npm ERR! premature close

如果“某些/包”实际上不存在。检查到 确保拼写正确 在你的包名上。

为了您的娱乐,我应该使用:
composer require some/package

关于github - npm 错误!使用 npm install 时过早关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56118038/

相关文章:

reactjs - npm ERR!找不到404-GET https://registry.npmjs.org/@typescript-eslint%2feslint-plugin-找不到

git - 当 git 子模块引用的 repo 被删除时会发生什么?

git - 卡在 Windows 上的 Git : Can't checkout, 无法存储,无法提交

npm - 未满足和不正确的对等依赖之间有什么区别?

javascript - 如何安装 popper v2?

angular - TS2307 内部版本 :Cannot find module 'lodash'

npm - 删除 package.json 中的插入符号是否安全?

node.js - npm install 在这么多警告后给出错误

python - 用于 Python 的 Github API : PyGithub - get a list of all commits for a particular repository

git - 从 GitHub API 中获取通过提交更改的文件