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

查看:683
本文介绍了从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下载源代码而不安装它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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