Skip to content

Commit a98a49a

Browse files
replace obsolete npm bin command (#5710)
Co-authored-by: James Daniels <jamesdaniels@google.com>
1 parent 2eb42bc commit a98a49a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
- Fix bug where Custom Event channels weren't automatically crated on function deploys (#5700)
55
- Lift GCF 2nd gen naming restrictions (#5690)
66
- Fixes a bug where `ext:install` and `ext:configure` would error on extensions with no params.
7+
- Fixed an issue with Vite and Angular integrations using a obsolete NPM command (#5710)

src/frameworks/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ function scanDependencyTree(searchingFor: string, dependencies = {}): any {
247247

248248
export function getNodeModuleBin(name: string, cwd: string) {
249249
const cantFindExecutable = new FirebaseError(`Could not find the ${name} executable.`);
250-
const npmBin = spawnSync("npm", ["bin"], { cwd }).stdout?.toString().trim();
251-
if (!npmBin) {
250+
const npmRoot = spawnSync("npm", ["root"], { cwd }).stdout?.toString().trim();
251+
if (!npmRoot) {
252252
throw cantFindExecutable;
253253
}
254-
const path = join(npmBin, name);
254+
const path = join(npmRoot, ".bin", name);
255255
if (!fileExistsSync(path)) {
256256
throw cantFindExecutable;
257257
}

0 commit comments

Comments
 (0)