| 12 | } |
| 13 | |
| 14 | const main = async ({ packageLock }) => { |
| 15 | await git('status') // run ANY @npmcli/git command to instantiate its lazy loading |
| 16 | await fs.rimraf(join(CWD, 'node_modules')) |
| 17 | for (const { path } of await pkg.mapWorkspaces()) { |
| 18 | await fs.rimraf(join(path, 'node_modules')) |
| 19 | } |
| 20 | |
| 21 | await cleanup() |
| 22 | await npm('i', '--ignore-scripts', '--no-audit', '--no-fund', packageLock && '--package-lock') |
| 23 | await npm('rebuild', '--ignore-scripts') |
| 24 | await npm('run', 'dependencies', '--ignore-scripts') |
| 25 | } |
| 26 | |
| 27 | run(main).catch(cleanup) |