Skip to content
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

Question regarding reference/dependency association #8

Open
brianeletype opened this issue Aug 16, 2018 · 4 comments
Open

Question regarding reference/dependency association #8

brianeletype opened this issue Aug 16, 2018 · 4 comments

Comments

@brianeletype
Copy link

I'm trying to get a simple POC going that somewhat mimics our monorepo and I'm running across a problem that I'm hoping someone can help with.

I set up everything seemingly like this example project, but when I run an npm i I get a message stating that my dependency can't be found. I can reproduce it by slightly modifying this repo...

If I change all the module names from @ryancavanaugh/* to @foo/* (the name of the module and the names of the deps) in the package.json files, I get a similar error...

I did a big find/replace to replace it with foo, go into pkg2, wipe out package-lock.json, and run npm i. I get npm ERR! 404 Not Found: @foo/pkg1@^3.0.2.

I can't tell if I'm doing something wrong or if I'm just missing something.

I really appreciate the repo though. It does seem to be a great example.

@ajhool
Copy link

ajhool commented Aug 16, 2018

I'm running into the same issue. I see pkg2/package.json contains:

"dependencies": {
    "@ryancavanaugh/pkg1": "^3.0.2"
  },

And I assume that the dependency can be added with yarn add @ryancavanaugh/pkg1, but yarn fails with the 404 error mentioned above. I also tried adding the line directly to package.json, which also doesn't work (I wouldn't expect that to be the solution, either).

I structured my projects as shown in this repo, but am not able to import projects from one to the other. The package.json dependency is the only difference AFAIK.

@brianeletype
Copy link
Author

So I guess RyanCavanaugh isn't doing anything with this repo anymore? Seems kinda lame to put up an example and just bail on it.

@ozyman42
Copy link

ozyman42 commented Jun 14, 2019

Guys this is a lerna example. You're supposed to use Lerna!

but yarn fails with the 404 error mentioned above.

Use
lerna bootstrap
In the monorepo root

@ozyman42
Copy link

I've created a CLI tool which automates the config file creation and npm linking via lerna for a setup like the one in this repo. Try it out & open and issue or PR! https://www.npmjs.com/package/@isomorphic-typescript/ts-monorepo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants