npm 离线安装

2017-04-20  本文已影响0人  peng_zhen

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

上一篇 下一篇

猜你喜欢

热点阅读