npm 离线安装

1, npm pack 命令

bundledDependencies

This defines an array of package names that will be bundled when publishing the package.

In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in thebundledDependenciesarray and executingnpm pack.

For example:

If we define a package.json like this:

{

    "name": "awesome-web-framework",

    "version": "1.0.0",

    "bundledDependencies": [

        'renderized', 'super-streams'

    ]

}

we can obtainawesome-web-framework-1.0.0.tgzfile by runningnpm pack. This file contains the dependenciesrenderizedandsuper-streamswhich can be installed in a new project by executingnpm install awesome-web-framework-1.0.0.tgz.

If this is spelled"bundleDependencies", then that is also honored.


2, npmbox

npmbox

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 沿着熟悉的路段、乘车来到熟悉的校园,看到了熟悉的人,聊着共同熟悉的话题!畅想着熟悉的工作与生活状态,不免为...
    唯美儿阅读 3,097评论 0 4
  • 自从《最强大脑》被爆出各种“最强黑幕”,而峰少也是眼睁睁的看着水哥王昱珩“被潜”,校长李威“防水”,就连作为名人堂...
    何鲸洛阅读 4,322评论 0 3
  • 不知道从什么时候起意识到自己备胎的身份,从此逃不过有时的暧昧有时的不理不睬,我爱的人潇洒的爱着别人,我默默地看着说...
    yy云烟阅读 3,813评论 0 0