Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Run install with force win32 (#47)
Browse files Browse the repository at this point in the history
* Avoid using prefix flag, instead use cwd of execa

* Alternative solution with --force

* Run with force on win32

* Fix cwd for execa

* Go back to using prefix
  • Loading branch information
Florian Richter authored Jan 9, 2020
1 parent ff5d4b5 commit 970b742
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/commands/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as execa from 'execa';
import * as glob from 'fast-glob';
import * as fs from 'fs';
import * as Listr from 'listr';
import { platform } from 'os';
import * as path from 'path';
import * as rm from 'rimraf';

Expand Down Expand Up @@ -103,9 +104,9 @@ export default class Package extends Command {
title: 'Install productive dependencies',
enabled: () => !flags.skipInstall,
task: async () =>
execa('npm', ['install', '--production', '--prefix', outputDir], { stdio: flags.verbose ? 'inherit' : 'ignore' }).catch(e =>
this.error(e, { exit: 10 })
)
execa('npm', ['install', '--production', `--prefix=${outputDir}`, ...(platform() === 'win32' ? ['--force'] : [])], {
stdio: flags.verbose ? 'inherit' : 'ignore'
}).catch(e => this.error(e, { exit: 10 }))
}
]);

Expand Down

0 comments on commit 970b742

Please sign in to comment.