Skip to content

Commit c5ec493

Browse files
Pass current stdio to npm install process (#2527)
Whenever CLI spawns `npm install <smth>`, we do not set stdin and stdout of the spawned process. This way in case any of the npm scripts executed during install requires input from user, it cannot be handled in any way. So pass the current stdin and stdout to the spawned npm process. This way in case a postinstall script is executed and it requires input from user, the users will be able to enter required information in the same place where `tns` command has been executed (same terminal). This fixes postinstall execution of `nativescript-plugin-firebase`.
1 parent 2746bff commit c5ec493

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/node-package-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class NodePackageManager implements INodePackageManager {
4545
}
4646
}
4747
try {
48-
let spawnResult:ISpawnResult = this.$childProcess.spawnFromEvent(this.getNpmExecutableName(), params, "close", { cwd: pwd }).wait();
48+
let spawnResult:ISpawnResult = this.$childProcess.spawnFromEvent(this.getNpmExecutableName(), params, "close", { cwd: pwd, stdio: "inherit" }).wait();
4949
this.$logger.out(spawnResult.stdout);
5050
} catch (err) {
5151
if (err.message && err.message.indexOf("EPEERINVALID") !== -1) {

0 commit comments

Comments
 (0)