从 npm 下载源代码而不安装它 [英] Download source from npm without installing it

查看:36
本文介绍了从 npm 下载源代码而不安装它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不实际安装的情况下从 npm 下载包的源代码(即不使用 npm install thepackage)?

How can I download the source code of a package from npm without actually installing it (i.e. without using npm install thepackage)?

推荐答案

你可以使用npm view [package name] dist.tarball,它会返回压缩包文件的URL.

You can use npm view [package name] dist.tarball which will return the URL of the compressed package file.

这是一个使用 wget 下载压缩包的示例:

Here's an example using wget to download the tarball:

wget $(npm view lodash dist.tarball)

这篇关于从 npm 下载源代码而不安装它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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