本文介绍了从npm下载源代码而不安装它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不实际安装(即不使用npm install thepackage
)的情况下从npm下载软件包的源代码?
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
下载tarball的示例:
Here's an example using wget
to download the tarball:
wget $(npm view lodash dist.tarball)
这篇关于从npm下载源代码而不安装它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!