Skip to content

Commit 0b42cc9

Browse files
Merge pull request #1087 from NativeScript/vladimirov/always-install-deps
Always call npm install when preparing project
2 parents 062163e + 6e3db2b commit 0b42cc9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/services/plugins-service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,11 @@ export class PluginsService implements IPluginsService {
189189

190190
public ensureAllDependenciesAreInstalled(): IFuture<void> {
191191
return (() => {
192-
if(!this.$fs.exists(path.join(this.$projectData.projectDir, constants.NODE_MODULES_FOLDER_NAME)).wait()) {
193-
let command = "npm install ";
194-
if(this.$options.ignoreScripts) {
195-
command += "--ignore-scripts";
196-
}
197-
this.$childProcess.exec(command, { cwd: this.$projectData.projectDir }).wait();
192+
let command = "npm install ";
193+
if(this.$options.ignoreScripts) {
194+
command += "--ignore-scripts";
198195
}
196+
this.$childProcess.exec(command, { cwd: this.$projectData.projectDir }).wait();
199197
}).future<void>()();
200198
}
201199

test/npm-support.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ describe("Npm support tests", () => {
192192
let scopedName = "@reactivex/rxjs";
193193
let scopedModule = path.join(projectFolder, "node_modules", "@reactivex/rxjs");
194194
let scopedPackageJson = path.join(scopedModule, "package.json");
195-
addDependencies(testInjector, projectFolder, {scopedName: "0.0.0-prealpha.3"}).wait();
195+
let dependencies: any = {};
196+
dependencies[scopedName] = "0.0.0-prealpha.3";
197+
// Do not pass dependencies object as the sinopia cannot work with scoped dependencies. Instead move them manually.
198+
addDependencies(testInjector, projectFolder, {}).wait();
196199
//create module dir, and add a package.json
197200
shelljs.mkdir("-p", scopedModule);
198201
fs.writeFile(scopedPackageJson, JSON.stringify({name: scopedName})).wait();

0 commit comments

Comments
 (0)