Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gulp does not work with PnP #6516

Closed
DanielRuf opened this issue Oct 8, 2018 · 15 comments
Closed

Gulp does not work with PnP #6516

DanielRuf opened this issue Oct 8, 2018 · 15 comments
Assignees

Comments

@DanielRuf
Copy link
Contributor

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
@ghost ghost assigned imsnif Oct 8, 2018
@ghost ghost added the triaged label Oct 8, 2018
@arcanis
Copy link
Member

arcanis commented Oct 10, 2018

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

@arcanis
Copy link
Member

arcanis commented Oct 10, 2018

Here's the Gulpfile I used: https://github.com/yarnpkg/pnp-sample-app/blob/master/gulpfile.js

@redeyes2015
Copy link

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.

@redeyes2015
Copy link

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.

@arcanis
Copy link
Member

arcanis commented Nov 2, 2018

Thanks! Will take a look

@arcanis
Copy link
Member

arcanis commented Nov 2, 2018

Will be fixed by #6623 👍

@brianespinosa
Copy link

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.

@arcanis
Copy link
Member

arcanis commented Nov 2, 2018

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?

@brianespinosa
Copy link

@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!

@brianespinosa
Copy link

brianespinosa commented Jan 9, 2019

@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

@brianespinosa
Copy link

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!

@asolopovas
Copy link

same here

@merceyz
Copy link
Member

merceyz commented Jan 2, 2021

Closing as fixed in #6623

@merceyz merceyz closed this as completed Jan 2, 2021
@bpsbais
Copy link

bpsbais commented Aug 12, 2021

Now yarn reached at it's version 3.0.0 and gulp reached at 4.0.2
But gulp is still not working in yarn pnp mode.

To run gulp in yarn we have to change yarn's mode pnp to node-modules as follow.

  1. insert nodeLinker: node-modules into .yarnrc.yml file.
  2. run yarn install
  3. now you can run gulp.

But we lost plug and play feature of yarn.

@SudoNova
Copy link

SudoNova commented May 8, 2022

Now yarn reached at it's version 3.0.0 and gulp reached at 4.0.2 But gulp is still not working in yarn pnp mode.

To run gulp in yarn we have to change yarn's mode pnp to node-modules as follow.

1. insert `nodeLinker: node-modules` into `.yarnrc.yml` file.

2. run `yarn install`

3. now you can run gulp.

But we lost plug and play feature of yarn.

Same here. STILL doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants