diff --git a/packages/api/core/src/util/install-dependencies.ts b/packages/api/core/src/util/install-dependencies.ts index cbc61b0a72..b561f4d719 100644 --- a/packages/api/core/src/util/install-dependencies.ts +++ b/packages/api/core/src/util/install-dependencies.ts @@ -26,9 +26,8 @@ export default async (dir: string, deps: string[], depType = DepType.PROD, versi if (depType === DepType.DEV) cmd.push('--dev'); if (versionRestriction === DepVersionRestriction.EXACT) cmd.push('--exact'); } else { - if (versionRestriction === DepVersionRestriction.EXACT) cmd.push('--save-exact'); if (depType === DepType.DEV) cmd.push('--save-dev'); - if (depType === DepType.PROD) cmd.push('--save'); + if (versionRestriction === DepVersionRestriction.EXACT) cmd.push('--save-exact'); } d('executing', JSON.stringify(cmd), 'in:', dir); try { diff --git a/packages/api/core/test/fast/install-dependencies_spec.ts b/packages/api/core/test/fast/install-dependencies_spec.ts index 425ed649c8..3ae3b6d889 100644 --- a/packages/api/core/test/fast/install-dependencies_spec.ts +++ b/packages/api/core/test/fast/install-dependencies_spec.ts @@ -78,7 +78,7 @@ describe('Install dependencies', () => { it('should install prod deps', () => { install('mydir', ['react']); - expect(spawnSpy.firstCall.args[0]).to.be.deep.equal(['install', 'react', '--save']); + expect(spawnSpy.firstCall.args[0]).to.be.deep.equal(['install', 'react']); }); it('should install dev deps', () => { @@ -88,12 +88,12 @@ describe('Install dependencies', () => { it('should install exact deps', () => { install('mydir', ['react-dom'], DepType.PROD, DepVersionRestriction.EXACT); - expect(spawnSpy.firstCall.args[0]).to.be.deep.equal(['install', 'react-dom', '--save-exact', '--save']); + expect(spawnSpy.firstCall.args[0]).to.be.deep.equal(['install', 'react-dom', '--save-exact']); }); it('should install exact dev deps', () => { install('mydir', ['mocha'], DepType.DEV, DepVersionRestriction.EXACT); - expect(spawnSpy.firstCall.args[0]).to.be.deep.equal(['install', 'mocha', '--save-exact', '--save-dev']); + expect(spawnSpy.firstCall.args[0]).to.be.deep.equal(['install', 'mocha', '--save-dev', '--save-exact']); }); }); });