You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, let me start by saying I'm not terribly versed in the whole Node/JS/monorepo ecosystem. It could (very well) be that this is a dumb question and has a simple answer.
I'm developing a CLI in Node. I have it in the apps directory of my NX Workspace. It uses several libraries (node modules) that are in the libs folder of my workspace. Currently all of these items are published to a private NPM repository, and this works well.
My problem is that I can't figure out how to set up my development environment so that it lets me develop the CLI inside my IDE while still satisfying all of its dependencies. Before I moved it to a mono-repo, this mostly worked in that I could simply npm i -g ./my-cli and it would link the global node executable to my current working directory and all the dependencies were satisfied. Now, using the monorepo, all of my apps get built out to the dist folder, but the projects don't have their own node_modules. I've actually tried using various tricks with npm link, then actually doing an npm install inside the dist folder, but this just seems wrong (and I couldn't get to work, anyway). I started reading that NX Works well with NPM Workspaces, but not sure if that's a rabbit hole worth going down.
I feel like there's probably a simple answer here, but I'm running at the end of my knowledge in this space. Appreciate any insight you might have.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First, let me start by saying I'm not terribly versed in the whole Node/JS/monorepo ecosystem. It could (very well) be that this is a dumb question and has a simple answer.
I'm developing a CLI in Node. I have it in the
apps
directory of my NX Workspace. It uses several libraries (node modules) that are in thelibs
folder of my workspace. Currently all of these items are published to a private NPM repository, and this works well.My problem is that I can't figure out how to set up my development environment so that it lets me develop the CLI inside my IDE while still satisfying all of its dependencies. Before I moved it to a mono-repo, this mostly worked in that I could simply
npm i -g ./my-cli
and it would link the global node executable to my current working directory and all the dependencies were satisfied. Now, using the monorepo, all of my apps get built out to thedist
folder, but the projects don't have their ownnode_modules
. I've actually tried using various tricks withnpm link
, then actually doing annpm install
inside thedist
folder, but this just seems wrong (and I couldn't get to work, anyway). I started reading that NX Works well with NPM Workspaces, but not sure if that's a rabbit hole worth going down.I feel like there's probably a simple answer here, but I'm running at the end of my knowledge in this space. Appreciate any insight you might have.
Thanks!
-Toby
Beta Was this translation helpful? Give feedback.
All reactions