【问题标题】:How can I install an npm module on a disconnected computer, ensuring all dependencies如何在断开连接的计算机上安装 npm 模块,确保所有依赖项
【发布时间】:2015-07-02 05:52:15
【问题描述】:

我需要在断开连接的计算机网络(无法访问 Internet)上工作,我希望使用 jsbin 进行 SharePoint/Windows 开发,强烈建议安装 npm,以确保所有依赖项都存在。

有没有办法在连接的计算机上运行 npm,然后将一个或多个文件夹复制到目标网络,从而将模块安装在具有 NodeJS 的另一台计算机上,无论是否使用 npm(?)

我看到了对 npm pack 的引用,但我对这个足够新(并且主要来自 Windows 环境),这对我来说不太有意义

【问题讨论】:

    标签: node.js windows npm offline


    【解决方案1】:

    我刚刚用 grunt-cli(另一个全局安装的包)对其进行了测试。

    # do this on connected computer
    npm install -g jsbin
    npm pack jsbin
    # this will drop a jsbin-[version number].tgz in the cwd
    # move this file to new computer and…
    
    # do this on not-connected computer
    npm install -g jsbin-[version number].tgz
    

    【讨论】:

    猜你喜欢
    • 2013-08-26
    • 1970-01-01
    • 1970-01-01
    • 2014-02-17
    • 2015-12-17
    • 2011-06-30
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    相关资源
    最近更新 更多