Yarn: Gulp does not work with PnP

Created on 8 Oct 2018  路  12Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

Bug

What is the current behavior?
"start": "gulp" and yarn start does not work with Yarn PnP

If the current behavior is a bug, please provide the steps to reproduce.

Create a new project with Gulp 3.9.1 and set the start script to gulp, and create a basic gulpfile.

What is the expected behavior?
Gulp should start.

Please mention your node.js, yarn and operating system version.

node --version && yarn --version
v10.11.0
1.13.0-20181004.1524
plugnplay triaged

Most helpful comment

Will be fixed by #6623 馃憤

All 12 comments

Can you make a repro PR on the pnp-sample-app repository? I've tested with Gulp before so there's likely an environment factor somewhere

I can reproduce in pnp-sample-app,

  1. Remove .yarnrc in the repository
  2. Remove .pnp.js
  3. invoke "globally installed" yarn v1.12.1. with yarn --pnp
  4. yarn gulp would report the error

BTW with .pnp.js generated by the yarn.js in the repository, I can run gulp successfully with yarn v1.12.1.

Given .yarnrc removed (so I can choose which yarn.js to use):

  1. With .pnp and .pnp.js generated by yarn.js packed in the repository (1.11.0-0), all versions of yarn I tested can run yarn gulp successfully.
  2. With .pnp and .pnp.js generated by yarn v1.12.1, either "installed globally" or downloaded as a single file and put in the repository, all versions fail to run yarn gulp

"all versions":

  1. 1.11.0-0 (packed in)
  2. 1.11.0-0 copied to elsewhere
  3. v1.12.1 "globally installed" ubuntu package
  4. v1.12.1 downloaded as a single file put in the repository
  5. v1.12.1 downloaded as a single file put elsewhere

Hope this helps.

Thanks! Will take a look

Will be fixed by #6623 馃憤

Thanks @arcanis

I see that your PR has been merged. Do you know if there is going to be a patch version bump of yarn to 1.12.2 that includes this? We just updated our yarn version today and this broke our builds.

Hey @brianespinosa ! There are a few other fixes I'd prefer to land before releasing the 1.12.2 (ETA ~ a week, I'd say), but in the meantime you can use our nightly build, which already includes it 馃檪

Would that work for you?

@arcanis ~a week should be fine. I just updated the config in our package.json telling it to not use pnp for now and everything is fine again. I can give it another shot when the patch lands. Thanks again!

@arcanis I just got around to testing this again. I am now running yarn 1.13.0 and when I run yarn gulp myCommand I get a message:

[11:40:52] Local gulp not found in ~/myProject
[11:40:52] Try running: npm install gulp

Ah! The trick here was to delete the old yarn.lock file and get an install from scratch. Now it does actually work. Thanks @arcanis!

same here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebmck picture sebmck  路  3Comments

esphen picture esphen  路  3Comments

davidmaxwaterman picture davidmaxwaterman  路  3Comments

MunifTanjim picture MunifTanjim  路  3Comments

torifat picture torifat  路  3Comments