I want to add a local dependency to
package.json`.
Say I have foo-1.0.0.tgz
file.
I do
yarn add file:foo-1.0.0.tgz
And for some reason I have this error
➤ YN0027: file:foo-1.0.0.tgz@unknown can’t be resolved to a satisfying range
➤ YN0035: The remote server failed to provide the requested resource
➤ YN0035: Response Code: 404 (Not Found)
➤ YN0035: Request Method: GET
➤ YN0035: Request URL: https://registry.yarnpkg.com/file:foo-1.0.0.tgz
➤ Errors happened when preparing the environment required to run this command.
What I'm doing wrong?
An important notice:
- I can install this package with npm
8.1.2
; - If I add the dependency manually to
package.json
and doyarn install
it seems to work. But then I run into problem: if one of the local packages depend on another one yarn fails - couldn't find that dependency. But I guess that issue is out of the scope of the question.
P.S. I'm using yarn 3.1.1
and node v16.13.2