Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Node.js version warning for standalone. Fix #2791. #4583

Merged
merged 4 commits into from May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -0,0 +1 @@
- Improves Node.js version warning for standalone Firebase CLI build (#2791).
19 changes: 15 additions & 4 deletions src/emulator/functionsEmulator.ts
Expand Up @@ -1014,10 +1014,21 @@ export class FunctionsEmulator implements EmulatorInstance {
);
} else {
// Otherwise we'll warn and use the version that is currently running this process.
this.logger.log(
"WARN",
`Your requested "node" version "${requestedMajorVersion}" doesn't match your global version "${hostMajorVersion}". Using node@${hostMajorVersion} from host.`
);
if (process.env.FIREPIT_VERSION) {
this.logger.log(
"WARN",
`You've requested "node" version "${requestedMajorVersion}", but the standalone Firebase CLI comes with bundled Node "${hostMajorVersion}".`
);
this.logger.log(
"INFO",
`To use a different Node.js version, consider removing the standalone Firebase CLI and switching to "firebase-tools" on npm.`
);
} else {
this.logger.log(
"WARN",
`Your requested "node" version "${requestedMajorVersion}" doesn't match your global version "${hostMajorVersion}". Using node@${hostMajorVersion} from host.`
);
}
}

return process.execPath;
Expand Down