We already have a utils package that outputs JavaScript. If we want to use that package inside any of our applications, in our case, blog or dashboard, we would have to install it first.
What did you do to stop npm install
a local package from reaching out to the npm registry? The command npm install @monorepo/utils --save -w @monorepo/blog -w @monorepo/dashboard
gives me an error E404 because obviously the @monorepo/utils is not a published package.
Hey @Michael! I’d double check a few things:
Thanks Alejandro. I double checked and they seem all good to me. I followed your course and created a project to follow along. Here is the commit which I manually added to the package.json to both apps/blog
and apps/dashboard
instead of run npm install @monorepo/utils --save -w @monorepo/blog -w @monorepo/dashboard
. This works as I can now import and use copyright
from the shared libs/utils
in both projects. Ideally I was hoping to be able to run the npm install like you demonstrated in the course.
I had the same experience but the work around is fine.
@Michael @Jason I had the same experience before but after upgrade Node version to v18 I can install the libs using npm install as in the video.
The "View code on Github" button doesn't bring me to the code in the video.
The "View code on Github" button doesn't bring me to the code in the video.
The github code brings you to the finished code of the course. To find the exact code in this lesson, you'll need to go back a few commits. I believe this is the exact commit for this lesson: https://github.com/alejandronanez/turborepo-egghead/commit/c9f4042d3f9ca3bdf0dee8ebe73375fb727554cd
Wow. Amazing how fast and smooth this works. Even on a desktop where I expect speed, I'm impressed the TS build and hmr update in both running apps happens faster than I can blink.