Skip to content

Commit c092c0f

Browse files
committed
v3: Prevent legacy-peer-deps=true from breaking deploys
1 parent a86f36c commit c092c0f

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

.changeset/warm-planes-taste.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
v3: Prevent legacy-peer-deps=true from breaking deploys
6+
7+
When a global `.npmrc` file includes `legacy-peer-deps=true`, deploys would fail on the `npm ci` step because the package-lock.json wouldn't match the `package.json` file. This is because inside the image build, the `.npmrc` file would not be picked up and so `legacy-peer-deps` would end up being false (which is the default). This change forces the `package-lock.json` file to be created using `legacy-peer-deps=false`

packages/cli-v3/src/commands/deploy.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,10 +1452,31 @@ async function resolveDependencies(
14521452
logger.debug(`No cached package-lock.json found for ${digest}`);
14531453

14541454
try {
1455-
await execa("npm", ["install", "--package-lock-only", "--ignore-scripts", "--no-audit"], {
1456-
cwd: projectDir,
1457-
stdio: logger.loggerLevel === "debug" ? "inherit" : "pipe",
1458-
});
1455+
if (logger.loggerLevel === "debug") {
1456+
const childProcess = await execa("npm", ["config", "list"], {
1457+
cwd: projectDir,
1458+
stdio: "inherit",
1459+
});
1460+
1461+
logger.debug("npm config list");
1462+
console.log(childProcess.stdout);
1463+
}
1464+
1465+
await execa(
1466+
"npm",
1467+
[
1468+
"install",
1469+
"--package-lock-only",
1470+
"--ignore-scripts",
1471+
"--no-audit",
1472+
"--legacy-peer-deps=false",
1473+
"--strict-peer-deps=false",
1474+
],
1475+
{
1476+
cwd: projectDir,
1477+
stdio: logger.loggerLevel === "debug" ? "inherit" : "pipe",
1478+
}
1479+
);
14591480

14601481
const packageLockContents = await readFile(join(projectDir, "package-lock.json"), "utf-8");
14611482

pnpm-lock.yaml

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

references/v3-catalog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"dotenv": "^16.4.5",
2020
"execa": "^8.0.1",
2121
"msw": "^2.2.1",
22-
"openai": "^4.28.0",
22+
"openai": "^4.47.0",
2323
"pg": "^8.11.5",
2424
"react": "^18.2.0",
2525
"react-email": "^1.6.1",

0 commit comments

Comments
 (0)