Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Fix npm install command (#4)
Browse files Browse the repository at this point in the history
The PR removes the `--legacy-peer-deps` since it is no longer required (`rollup-plugin-swc3` has fixed this).

The PR also adds `--install-links`. By default when npm installs the linked `@swc/core` from the local folder, it will not install the transitive dependencies (`@swc/types`). `--install-links` fixes that.
See also: npm/cli#2339
  • Loading branch information
SukkaW authored Oct 13, 2023
1 parent 777021b commit 2f92ef0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ export async function applyPackageOverrides(
} else if (pm === "yarn") {
await $`yarn install`;
} else if (pm === "npm") {
// TOOD(kdy1): This is required just for https://github.com/SukkaW/rollup-plugin-swc
await $`npm install --legacy-peer-deps`;
// The transitive dependencies of the linked dependencies will not be installed by `npm i` unless `--install-links` is specified.
// See https://github.com/npm/cli/issues/2339#issuecomment-1111228605
await $`npm install --install-links`;
}
}

Expand Down

0 comments on commit 2f92ef0

Please sign in to comment.