-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Can't install new dependencies into workspace package with workspace dependencies #2035
Comments
This is probably related to what I described in #2036 (comment). The current answer in #2036 (comment) is that |
I have the same issue |
@justinfagnani we're working on improving the workspace experiences for these types of scenarios this quarter. |
Starting from npm@7.14.0
It's also possible to install a workspace into another, e.g:
|
@ruyadorno - I found that
in this case. EDIT: adding exact procedure to recreate the error when NOT using the exact version, but the commands that @ruyadorno provided. I am using
In an empty folder execute a shell script as follows:
The output (ending in a error ) is a as follows -
|
This works when adding the dependency in the lerna monorepo. I am running into issues, however, when I try installing a tarball that has this internal dependency. For example:
If workspace |
@Brennvo - Can you show the working commands you used, including the |
Unbelievable. Look at this. npm init -y
npm init -w packages/a -y
npm init -w packages/b -y ...Everything is OK npm i b@1.0.0 -w a
npm init -w packages/c -y Created package npm i c@1.0.0 -w a Added package Now magic happens npm init -w packages/z -y Created package npm i z@1.0.0 -w a npm ERR! code ETARGET
npm ERR! notarget No matching version found for z@1.0.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
How is that possible? It turns out that package name matters when you work with workspaces. @wraithgar @fritzy @lukekarrys could you please comment on this? |
I'm having the same problem; Package with name: It works only when I change |
I created separated issue #4379 |
Current Behavior:
npm i some-package
fails if run in a workspace package that depends on another workspace package. The error is that the other workspace package is not found in the registray:Here
other-package
is a private package in the same workspace.You also can't add a dependency manually and run
npm i
in the root of the workspace due to #1984So there appears to be no way to add new dependencies in a workspace, aside from deleting the top-level node_modules folder and package-lock.
Expected Behavior:
npm i
inside a workspace package should update the package.json file and install the dependency.Steps To Reproduce:
a
andb
, witha
depending onb
packages/a
npm i {some-package}
Environment:
The text was updated successfully, but these errors were encountered: