从 npm 下载一个包作为 tar(不将其安装到模块) [英] Download a package from npm as a tar (not installing it to a module)

查看:110
本文介绍了从 npm 下载一个包作为 tar(不将其安装到模块)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一些 URL 可以让我从 npm 下载给定的包(作为 tarball 或其他形式)?我需要最初上传到 npm 的确切文件.

Is there some URL from which I can download a given package from npm (as a tarball or something)? I need the exact files that were originally uploaded to npm.

例如,使用 npm install 会得到一个不同的生成的 package.json.我想要已发布的确切原始文件集.

Using npm install gets a different, generated package.json for example. I want the exact original set of files that was published.

推荐答案

你可以使用 npm view 获取注册表 tarball 的 URL(在此示例中为模块 level):

$ npm view level dist.tarball

要下载 tarball,您可以使用 npm pack:

And to download tarball, you can use npm pack:

$ npm pack level

这篇关于从 npm 下载一个包作为 tar(不将其安装到模块)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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