I've been using async/await
code inside a generator that I've been creating and have not faced any issue
async prompting() {
await someFunction()
}
But when i try to use this same pattern on runInstall
, yarnInstall
or npmInstall
it seems to fail.
async install() {
this.log('in');
await this.runInstall('npm', 'mocha', {verbose: true});
this.log('yahooooooooo');
}
The code exits after it reaches the await command. I checked the code and it is returning a promise (yarnInstall
and npmInstall
internally uses runInstall
) so no problem there.
I know i can work around this by using spawnCommandSync
, but that is not the aim of this question.
I want to understand why it is not working or what am i doing wrong? My guess is that it has something to do with shell
like shell is trying to access another shell
(not exactly this, but something along the lines).