You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install a firebase extension like firestore-counter
Start the emulator
Verify that no node_modules exist in extension folder
[REQUIRED] Expected behavior
npm install was executed in the functions directory of an extension
[REQUIRED] Actual behavior
npm install gets executed, however, the path passed to child_process.spawn is not valid on Windows machines as it contains multiple forward slashs /. Normally Node would handle platform dependent paths, however in this case the path is directly passed to CMD on Windows.
stfsy
changed the title
On Windows Extension dependencies do not get installed
On Windows Extension dependencies do not get installed. PR created ✔
Dec 27, 2022
~ Let's make sure your Firebase CLI is ready...undefined:1SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at ChildProcess.<anonymous> (C:\snapshot\firepit\welcome.js:115:27) at ChildProcess.emit (node:events:527:28) at maybeClose (node:internal/child_process:1092:16) at Socket.<anonymous> (node:internal/child_process:451:11) at Socket.emit (node:events:527:28) at Pipe.<anonymous> (node:net:709:12)
[REQUIRED] Environment info
firebase-tools: 11.19.0
Platform: Windows
[REQUIRED] Test case
#5371 contains a fix and a unit test.
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
npm install
was executed in the functions directory of an extension[REQUIRED] Actual behavior
npm install
gets executed, however, the path passed tochild_process.spawn
is not valid on Windows machines as it contains multiple forward slashs/
. Normally Node would handle platform dependent paths, however in this case the path is directly passed toCMD
on Windows.firebase-tools/src/emulator/extensionsEmulator.ts
Lines 173 to 175 in 86a5ba1
We can fix the behaviour by having Node resolve the path first and then the passing the path to
child_process.spawn
ascwd
.https://github.com/stfsy/firebase-tools/blob/f6ab8a52a1f3c0f802ed4d8161fdf54fd04e747a/src/emulator/extensionsEmulator.ts#L174-L178
Therefore, I already provided PR #5371 which with an additional test case to ensure that dependencies get installed on Windows.
The text was updated successfully, but these errors were encountered: