Skip to content

Commit

Permalink
fix(cli): include ajv in devDependencies for Expo Router and npm (#2842
Browse files Browse the repository at this point in the history
… by @coolsoftwaretyler)

* fix(cli): include ajv in devDependencies for Expo Router and npm

* fix(cli): specify ajv devDependency, but only when necessary
  • Loading branch information
coolsoftwaretyler authored Nov 13, 2024
1 parent 83b5cb5 commit 6baf76b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,11 @@ module.exports = {
// do base install
const installCmd = packager.installCmd({ packagerName })
await system.run(installCmd, { onProgress: log })
// If they chose npm and also Expo Router, we need to run npm install ajv@^8 --legacy-peer-deps.
// see https://github.com/infinitered/ignite/issues/2840
if (packagerName === "npm" && experimentalExpoRouter) {
await system.run(`npm install ajv@^8 --legacy-peer-deps`, { onProgress: log })
}
// now that expo is installed, we can run their install --fix for best Expo SDK compatibility
const forwardOptions = packagerName === "npm" ? " -- --legacy-peer-deps" : ""
await system.run(`npx expo install --fix${forwardOptions}`, { onProgress: log })
Expand Down

0 comments on commit 6baf76b

Please sign in to comment.