diff --git a/.changeset/warm-planes-taste.md b/.changeset/warm-planes-taste.md new file mode 100644 index 0000000000..baef6d88cd --- /dev/null +++ b/.changeset/warm-planes-taste.md @@ -0,0 +1,7 @@ +--- +"trigger.dev": patch +--- + +v3: Prevent legacy-peer-deps=true from breaking deploys + +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` diff --git a/packages/cli-v3/src/commands/deploy.ts b/packages/cli-v3/src/commands/deploy.ts index 262f2bf1d2..5b9c8f1964 100644 --- a/packages/cli-v3/src/commands/deploy.ts +++ b/packages/cli-v3/src/commands/deploy.ts @@ -1452,10 +1452,31 @@ async function resolveDependencies( logger.debug(`No cached package-lock.json found for ${digest}`); try { - await execa("npm", ["install", "--package-lock-only", "--ignore-scripts", "--no-audit"], { - cwd: projectDir, - stdio: logger.loggerLevel === "debug" ? "inherit" : "pipe", - }); + if (logger.loggerLevel === "debug") { + const childProcess = await execa("npm", ["config", "list"], { + cwd: projectDir, + stdio: "inherit", + }); + + logger.debug("npm config list"); + console.log(childProcess.stdout); + } + + await execa( + "npm", + [ + "install", + "--package-lock-only", + "--ignore-scripts", + "--no-audit", + "--legacy-peer-deps=false", + "--strict-peer-deps=false", + ], + { + cwd: projectDir, + stdio: logger.loggerLevel === "debug" ? "inherit" : "pipe", + } + ); const packageLockContents = await readFile(join(projectDir, "package-lock.json"), "utf-8"); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79d34dfcc3..908897bfd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3096,8 +3096,8 @@ importers: specifier: ^2.2.1 version: 2.2.1(typescript@5.3.3) openai: - specifier: ^4.28.0 - version: 4.28.0 + specifier: ^4.47.0 + version: 4.47.1 pg: specifier: ^8.11.5 version: 8.11.5 @@ -28164,15 +28164,14 @@ packages: - encoding dev: false - /openai@4.28.0: - resolution: {integrity: sha512-JM8fhcpmpGN0vrUwGquYIzdcEQHtFuom6sRCbbCM6CfzZXNuRk33G7KfeRAIfnaCxSpzrP5iHtwJzIm6biUZ2Q==} + /openai@4.33.1: + resolution: {integrity: sha512-0DH572aSxGTT1JPOXgJQ9mjiuSPg/7scPot8hLc5I1mfQxPxLXTZWJpWerKaIWOuPkR2nrB0SamGDEehH8RuWA==} hasBin: true dependencies: '@types/node': 18.19.20 '@types/node-fetch': 2.6.4 abort-controller: 3.0.0 agentkeepalive: 4.5.0 - digest-fetch: 1.3.0 form-data-encoder: 1.7.2 formdata-node: 4.4.1 node-fetch: 2.6.12 @@ -28181,8 +28180,8 @@ packages: - encoding dev: false - /openai@4.33.1: - resolution: {integrity: sha512-0DH572aSxGTT1JPOXgJQ9mjiuSPg/7scPot8hLc5I1mfQxPxLXTZWJpWerKaIWOuPkR2nrB0SamGDEehH8RuWA==} + /openai@4.47.1: + resolution: {integrity: sha512-WWSxhC/69ZhYWxH/OBsLEirIjUcfpQ5+ihkXKp06hmeYXgBBIUCa9IptMzYx6NdkiOCsSGYCnTIsxaic3AjRCQ==} hasBin: true dependencies: '@types/node': 18.19.20 diff --git a/references/v3-catalog/package.json b/references/v3-catalog/package.json index d1f97e766b..40b5da4c03 100644 --- a/references/v3-catalog/package.json +++ b/references/v3-catalog/package.json @@ -19,7 +19,7 @@ "dotenv": "^16.4.5", "execa": "^8.0.1", "msw": "^2.2.1", - "openai": "^4.28.0", + "openai": "^4.47.0", "pg": "^8.11.5", "react": "^18.2.0", "react-email": "^1.6.1",