Skip to content

Commit 8722364

Browse files
Merge pull request #4668 from easadev/feat/cli-4667/support-yarn-workspace
feat(yarn): yarn support for workspaces
2 parents fb5f155 + 019a051 commit 8722364

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/services/plugins-service.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PluginsService implements IPluginsService {
4242
}
4343

4444
const name = (await this.$packageManager.install(plugin, projectData.projectDir, this.npmInstallOptions)).name;
45-
const pathToRealNpmPackageJson = path.join(projectData.projectDir, "node_modules", name, "package.json");
45+
const pathToRealNpmPackageJson = this.getPackageJsonFilePathForModule(name, projectData.projectDir);
4646
const realNpmPackageJson = this.$fs.readJson(pathToRealNpmPackageJson);
4747

4848
if (realNpmPackageJson.nativescript) {
@@ -215,7 +215,10 @@ export class PluginsService implements IPluginsService {
215215
}
216216

217217
private getPackageJsonFilePathForModule(moduleName: string, projectDir: string): string {
218-
return path.join(this.getNodeModulesPath(projectDir), moduleName, "package.json");
218+
const pathToJsonFile = require.resolve(`${moduleName}/package.json`, {
219+
paths: [projectDir]
220+
});
221+
return pathToJsonFile;
219222
}
220223

221224
private getDependencies(projectDir: string): string[] {

0 commit comments

Comments
 (0)