generator-node icon indicating copy to clipboard operation
generator-node copied to clipboard

--skip-install not working

Open springcomp opened this issue 4 years ago • 3 comments

I’m creating my own generator and compose with this generator-node while trying to skip installing dependencies. This used to work with version 4.2.0 however, it no longer does with a more recent 5.x version.

	public async default() {
		this.composeWith(require.resolve('generator-node/generators/app'), {
			boilerplate: false,
			name: this.options.name,
			projectRoot: 'generators',
			skipInstall: this.options["skip-install"],
		});
	}

springcomp avatar Dec 31 '21 13:12 springcomp

👋 @springcomp I know it's been a while, but from https://github.com/yeoman/yeoman/issues/1779 we're rebooting maintenance here. Is this issue still something you're interested in resolving?

If so, could you please post a full reproduction (https://antfu.me/posts/why-reproductions-are-required)? We'll need to be able to look at and run your code in order to help. Thanks! 🎩

JoshuaKGoldberg avatar Jan 24 '25 15:01 JoshuaKGoldberg

Hello @JoshuaKGoldberg yes I’m very much interested in a proper solution for this issue. I’ll try and come up with a small repro case and will come back to you here.

springcomp avatar Jan 24 '25 15:01 springcomp

Hey @JoshuaKGoldberg,

The snippet in the OP is coming out of my custom TypeScript generator. This version is published as v0.8.0. I can attest that it worked at the time with the following conditions:

  • NodeJS 12.22.12
  • Yo version 4.0.0

I will update this post to narrow down the versions after which it stopped working.

springcomp avatar Jan 29 '25 16:01 springcomp

Closing out as non-actionable. If anybody has a reproduction / more information, please do post back. Cheers! 🎩

JoshuaKGoldberg avatar Nov 05 '25 14:11 JoshuaKGoldberg

this.composeWith is async in yo 5 due to ESM import and should be sync in yo 6 with node that supports requiring ESM.

mshima avatar Nov 05 '25 20:11 mshima

skipInstall is an environment option now, you should pass through cli or set it in environment.

this.env.options.skipInstall = true;

mshima avatar Nov 05 '25 20:11 mshima