我正在尝试使用 Yarn 2 将模块安装到离线计算机上。
我有NPM模块的
.tgz
文件。看起来可以使用 Yarn 1.x 完成,但似乎不适用于 Yarn 2。
我将文件
lowdb-1.0.0.tgz
放入项目文件夹的根目录中进行测试,并尝试了这些不起作用(项目配置为Yarn 2):
yarn add lowdb-1.0.0.tgz
YN0027: lowdb-1.0.0.tgz@unknown can't be resolved to a satisfying range
YN0001: RequestError: getaddrinfo ENOTFOUND registry.yarnpkg.com
...
yarn add ./lowdb-1.0.0.tgz
YN0000: Resolution step
YN0013: lowdb@file:./lowdb-1.0.0.tgz::locator=reaction%40workspace%3A. can't be found in the cache and will be fetched
YN0001: RequestError: getaddrinfo ENOTFOUND registry.yarnpkg.com
...
yarn add file:./lowdb-1.0.0.tgz
Internal Error: Invalid descriptor (file:./lowdb-1.0.0.tgz)
...
这可以用 Yarn 2 来做吗?或者是否有另一种方法可以使用 Yarn 2 使用下载的 asset/bundles/tgz 将模块直接安装到离线计算机上?
查看https://classic.yarnpkg.com/lang/en/docs/cli/add/
纱线添加$( pwd )/lowdb-1.0.0.tgz