All Questions
181
questions
57
votes
4
answers
22k
views
How to build a docker image from a nodejs project in a monorepo with yarn workspaces
We are currently looking into CI/CD with our team for our website. We recently also adapted to a monorepo structure as this keeps our dependencies and overview a lot easier. Currently testing etc is ...
22
votes
2
answers
3k
views
How to deploy one app from a large monorepo with dependencies to packages in the same repo to google app engine?
I have a large node.js monorepo with several applications and packages and inter dependencies. It is all managed with yarn workspaces and a little bit of lerna. Everything works great for me, however ...
21
votes
3
answers
23k
views
NPM Workspaces Typescript unable to find local modules
I have a NodeJS monorepo set up using NPM workspaces and Typescript. It works fine without Typescript, however introducing TS brings some dependency resolving errors with it. Current directory setup:
+...
20
votes
8
answers
20k
views
share env variable beween turborepo monorepo project
I ve setup a basic turborepo project and I want to share .env variables across the all the apps and some of packages. If I set one .env file in the root of project and how can all apps and packages ...
19
votes
4
answers
6k
views
Firebase Functions with Yarn workspaces
We're starting to adopt a monorepo setup using yarn workspaces and we'd like to have our firebase functions inside it. The repo structure is something like:
repo
node_modules <- all ...
15
votes
4
answers
13k
views
How do I load a package from a package in a Lerna monorepo?
I have:
packages
-models
-package.json
-....
-server
-src
-index.ts
-package.json
In my packages/server/package.json, I have:
"scripts": {
"dev": "ts-node src/index.ts"
},...
15
votes
2
answers
19k
views
Lerna. Install dependencies to root project
I have standard Lerna repository like this:
my-repo
- package.json
- packages
- api
- package.json
- web-app
- package.json
If I need same dependency in both packages (for example ...
15
votes
2
answers
7k
views
How to bump version in all the packages when using yarn workspaces?
When using Yarn Workspaces, we have a project structure like:
- package.json
- packages/
- package-a/
- package.json
- index.js
- package-b/
- package.json
- ...
14
votes
1
answer
17k
views
Issues building a TypeScript monorepo project
I have a fairly simple mono repo. It is available on GitLab
here. This uses yarn workspaces, TypeScript, Jest, ts-jest
and ESLint with eslint-plugin-import.
I am trying to properly build the project ...
12
votes
2
answers
3k
views
Using Peer Dependencies With Local (file:../some-lib) Dependencies
I have a monorepo that has many micro-services in it. There are some library-type functions / classes that I want to make available to any micro-service that needs it. However, if that library package ...
11
votes
1
answer
6k
views
pnpm in monorepo - how to run a command only in a specific package?
Let's say I want to install a package in a specific package in my monorepo, how do I do this from root?
in npm, you can do this with something like this:
npm install react --workspace=a
I searched ...
11
votes
1
answer
9k
views
monorepo Yarn workspaces - shared esLint and Prettier configs
How someone could share esLint/prettier config across Yarn workspaces(no NPM, Lerna and etc).
I try to keep things pretty high level but I have tried to create a separate package for esLint config and ...
11
votes
1
answer
2k
views
Typescript: resolve relative import path when using symlinks
This seems like a dumb question, but I struggle to find the answer.
The situation
Here is my folder structure:
myProject/
├── module1/
│ ├── config.ts
│ └── init.ts #symlink
├── module2/
│ ├── ...
10
votes
5
answers
47k
views
Npm workspaces - call workspace script from root package
I'm struggling with multiple npm packages in a root git repository with custom dev scripts to handle launch, compile, build and so on. Now I came across npm workspaces and wanted to use this stunning ...
9
votes
1
answer
2k
views
Running ESLint in project subdir yields "heap out of memory"
If I run eslint . from my project-root, it prints all errors and warnings to the console, as I would expect it to.
However, when I cd into a subdirectory of the project, eslint . yields the following ...
9
votes
0
answers
785
views
Importing files in subdirectories when using Yarn Workspaces and Typescript
I'm having trouble porting a Yarn Workspaces monorepo to TypeScript. In the previous working version of the monorepo, moduleA could import something from a subdirectory of moduleB.
The new ported code ...
8
votes
0
answers
2k
views
Lerna avoid symlink
I'm using the below command
lerna bootstrap --hoist
I want lerna to install all dev and prod dependencies of the packages to the main root node_modules.
Some packages are dependencies of each other.
...
7
votes
2
answers
5k
views
NX Error for Relative Imports within the Same Project
I'm getting an error when using TS aliased paths within the same project: Projects should use relative imports to import from other files within the same project
I don't want this behavior. Any idea ...
7
votes
0
answers
7k
views
Passing all node_modules path to AWS CodeBuild cache
Currently I'm using AWS CodeBuild to deploy my monorepo project and I'm trying to use its cache properties. I want to cache my node_modules folder and my buildspec.yml is:
version: 0.2
phases:
...
7
votes
0
answers
629
views
How do I get Heroku CI to run tests when using a monorepo?
I have a nodejs app in a subdirectory called node-server of a monorepo project.
I was able to leverage heroku-buildpack-monorepo project to allow me to deploy just the node-server directory to ...
6
votes
2
answers
906
views
Pointing the main field in package.json conditionally
I have a Monorepo under Lerna and Yarn Workspaces. The repo has packages which are published to npm and consumed outside the monorepo as well as within the monorepo. While developing in the monorepo ...
6
votes
1
answer
4k
views
Turborepo -- how to nest applications in the 'apps' folder or different top-level directory?
I'm trying to create a turborepo that contains several types of infrastructure like terraform, potentially 100+ 'serverless' functions.
Ideally, I'd like to organize them a bit more into a subfolder ...
6
votes
1
answer
4k
views
How to publish yarn workspace with root package.json dependencies?
I'm trying to publish one (yarn) workspace from a monorepo to npm repository, and include root project's dependencies in the published package. The setup is as follows:
package.json (contains shared ...
5
votes
1
answer
2k
views
Prepare standalone directory to deploy package in a monorepo using npm workspaces
I have a monorepo that uses npm workspaces.
root/
app/
package.json
server/
package.json
store/
package.json
utils/
package.json
The app/package.json file references private non-...
5
votes
1
answer
2k
views
Publish NPM package that uses a workspaces as dependencies
so I have a project that I'm working on that is a Monorepo. So I have a packages directory in the root directory that contains all my npm packages. Some of these packages rely on eachother e.g. in a ...
5
votes
1
answer
2k
views
Why vscode doesn't intellisense function inside packages in typescript monorepo?
I created a monorepo with lerna (the code in github).
Inside I have two packages each package export sum function.
In app1 folder I want to import this function but vscode doesn't find the function.
...
5
votes
1
answer
2k
views
yarn: install local package from monorepo and use it inside docker image with offline cache
My folder structure looks like this (monorepo):
project
|
+--- /api
| |
| +--- /.offline-cache
| +--- /src
| | +--- index.js
| | +--- ...
| |
| +--- Dockerfile
| +--- ...
5
votes
2
answers
16k
views
Monorepo – Yarn workspaces Typescript Node.JS project – cannot find module when running nodemon
I've set up a monorepo using yarn workspaces for a typescript Node.JS project. Building the project works fine, however, I'm running into issues during local development.
I need to manually run yarn ...
5
votes
1
answer
1k
views
Error: Cannot find module '@nrwl/workspace/src/utilities/perf-logging'
I have try run Angular project of nxMonrepo and I have already install all node_modules and it didnot show any error when I try to run PS C:\Users\Dell\Desktop\MEANAPP\EAAPP> nx migrate --run-...
5
votes
0
answers
435
views
How to share node_modules between multiple docker containers in a monorepo, built with docker compose?
I have a monorepo project like this:
root
--package.json
--node_modules
--packages
----packageA (frontend)
------node_modules
------package.json
------Dockerfile
----packageB (backend)
------...
4
votes
1
answer
7k
views
How to use yarn add/npm install with monorepos
I need to download a node package from a private monorepo in GitHub, similar to this:
monorepoProject
--- subProjectA
--- subProjectB
And both subProjectA and subProjectB are typescript projects, ...
4
votes
1
answer
555
views
How can I make heroku/nodejs buildpack dump yarn logs into console instead of a tmp file?
Everything's sort of in the question, but here's some details. I have an monorepo structure like this, built on yarn workspaces:
my_app/
├─ node_modules/
├─ packages/
│ ├─ backend/
│ │ ├─ package....
4
votes
1
answer
2k
views
Typescript builds files with incorrect path in monorepo
I have an example monorepo with 3 packages: back, front and shared. With the following folder structure:
root
├── back
│ ├── dist
│ ├── src
│ ├── test.ts
│ ├── package.json
│ └── ...
4
votes
0
answers
393
views
How can I prevent forbidden dependencies in a monorepo based on npm workspaces and typescript project references?
I am trying to establish module boundaries on compile level in typescript/npm based monorepos but cannot find a way to achieve it. How can I prevent arbitrary imports violating module boundaries?
I ...
4
votes
1
answer
893
views
How do I create a production build of a typescript monorepo application that is compatible with an Azure Function App?
I am trying to wrap my head around typescript project references and how they are intended to be used in a production build, specifically for an Azure Function App.
I am not using any functionality ...
4
votes
2
answers
2k
views
How can I use my own monorepos as package.json dependencies directly from github?
I am heavily using github directly (i.e. not using the npm registry) for my own reusable node modules. So what I do in my package.json (I use yarn classic) is this:
"dependencies": {
&...
4
votes
0
answers
308
views
What is the right way of building and running repos using Yarn Workspaces?
I've been working on a project using monorepo and leveraging yarn workspaces.
It consists of several apps and common, e.g.
"server" (TS/Node app),
"web" (React app with Material ...
4
votes
2
answers
793
views
Share tools in root package.json with all packages
I'm building a monorepo using Lerna and npm. It has a typical structure of a root package.json and more packages in subdirectory packages/*.
Each package has a script called build that depends on ...
3
votes
1
answer
3k
views
Nrwl Nx build node project only transpiles main.ts
I'm new to Nrwl and monorepos. I have a node app which I'm trying to build using nx build [project-name]. My node app has a handful of typescript files in a folder structure under the src folder ...
3
votes
2
answers
6k
views
How to deploy monorepo powered by turborepo to Vercel?
Recently, Turborepo is acquired by Vercel. So I was excited to experiment with that. I created a turbo repo project by running
pnpx create-turbo
Then I tried to deploy it to Vercel following the ...
3
votes
3
answers
5k
views
AWS Lambda packaging with dependencies
Further outlining is in the context of NodeJS and Monorepo (based on Lerna).
I have AWS stack with several AWS Lambda inside deployed by means of AWS CloudFormation. Some of the lambdas are simple (...
3
votes
1
answer
4k
views
Lerna build fails on remote - internal packages are badly symlinked
I have a monorepo project created with lerna.
I am trying to create a CI flow to test my repository installation and build actions on a remote environment.
After hitting lerna bootstrap to install all ...
3
votes
0
answers
1k
views
TurboJs: Support for lockfiles without a 'packages' field isn't implemented yet
After upgrading turbo from 1.8.2 to 1.8.3, I receive this error message:
Issues occurred when constructing package graph. Turbo will function, but some features may not be available: 18 errors ...
3
votes
0
answers
408
views
NodeJS monorepo - different NodeJS versions in different services?
I'm working with a pretty big monorepo (~40 different services) and the team wants to upgrade the used NodeJS version in them incrementally (one-by-one upgrade from NodeJS 12 to 18).
Running yarn ...
3
votes
0
answers
1k
views
Use a library installed in monorepo root in other packages
I have a monorepo with a structure that is close to:
packages/
client/
src/
package.json
server/
src/
package.json
shared/
src/
package.json
...
3
votes
0
answers
1k
views
Prune command not working on Windows & M1/M2
I have a monorepo made following turborepo's documentation, on Linux machines it builds the entire monorepo and all the docker containers flawlessly but when it comes to either Windows (WSL2 on both ...
3
votes
0
answers
3k
views
Nx - how to import from another module when building with the tsc executor?
I have a problem that is similar to the one described in Building library with imports from another library using NX Monorepo.
Using nx monorepo with a node app and a library. The app is built with @...
3
votes
0
answers
2k
views
What is going wrong with my shared deps in vercel monorepo?
I have a problem with my monorepo, I try to deploy a standard express.js application but the shared dependencies don't load after the deployment, it works in local development.
Has anyone ever ...
3
votes
0
answers
469
views
NextJS - React-Native monorepo with react-native-elements
I'm trying to use react-native-elements in a react-native monorepo.
It works fine in the Native App, but not in the NextJS Application.
First, it compiles successfully:
> with-react-native-web@ dev ...
3
votes
1
answer
1k
views
Should I use yarn workspaces on production?
Me and a coworker are working on the deploy of some APIs that have some sharedlibs in common.
The thing is, he said that workspaces shouldn't be used in production, but no reason was presented to ...