yo icon indicating copy to clipboard operation
yo copied to clipboard

Bug: Yeoman runs `npm` or `yarn` multiple times.

Open brandones opened this issue 5 years ago • 0 comments

The docs state

Yeoman will ensure the npm install command is only run once even if it is called multiple times by multiple generators.

However, Yeoman appears to be running Yarn multiple times in my project:

screenshot

My environment

  • OS version/details: Ubuntu 19.10
  • Node version: 12.16.1
  • npm version: 6.14.1
  • Version of yo : 3.1.1

Expected behavior

Yeoman should run Yarn exactly once.

Current behavior

Yeoman runs yarn twice.

Steps to reproduce the behavior

See https://github.com/single-spa/create-single-spa/blob/9f80def0e3df929ba22dd4c06912505feafc4019/packages/generator-single-spa/src/react/generator-single-spa-react.js#L156-L167 .

Check out https://github.com/single-spa/create-single-spa/tree/9f80def0e3df929ba22dd4c06912505feafc4019 .

~/C/p/m/create-single-spa $ cd ..
~/C/p/mf $ mkdir gen-test
~/C/p/mf $ cd gen-test
~/C/p/m/gen-test $ ../create-single-spa/packages/create-single-spa/bin/create-single-spa.js

? Select type to generate single-spa application / parcel
? Which framework do you want to use? react
? Which package manager do you want to use? yarn
? Will this project use Typescript? Yes
? Organization name (use lowercase and dashes) op
? Project name (use lowercase and dashes) fe

Command line output

See pastebin. The important part is the end:

Done in 4.20s.
Project setup complete!
Steps to test your React single-spa application:
1. Run 'yarn start --https --port 8500'
2. Go to https://single-spa-playground.org/playground/instant-test?name=@op/fe&url=8500 to see it working!
yarn install v1.21.1
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.43s.

Where that first "Done" is from the first yarn run.

brandones avatar Apr 09 '20 03:04 brandones