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

Parcel auto installs packages with yarn not npm causing errors #91

Open
plinnegan opened this issue May 18, 2020 · 0 comments
Open

Parcel auto installs packages with yarn not npm causing errors #91

plinnegan opened this issue May 18, 2020 · 0 comments

Comments

@plinnegan
Copy link

plinnegan commented May 18, 2020

Up to this point 'Calling the pet api' commit 0f7977 is using npm only, however in this part of the video where Brian imports "@frontendmasters/pet" and hits save, parcel now uses yarn to install the package, even though there is a package-lock.json (not your fault I realise 😅).

Steps to reproduce:

(have yarn installed on your system)

  1. git clone https://github.com/btholt/complete-intro-to-react-v5.git
  2. cd complete-intro-to-react-v5/
  3. git checkout 0f7977a
  4. npm install
  5. npm run dev
  6. cd src
  7. touch SearchParams.js
  8. Add content of SearchParams file from video up till this point
  9. Open App.js and import SearchParams
  10. Hit save when parcel is running
  11. I got the attached logs
    err.log

If there is some way to specify that parcel should use npm if it finds a package-lock.json that would be great, but I realise that's out of your control! It seems stupid to me to use yarn when parcel can clearly see there is a package-lock.json and no yarn.lock.

Fix:
Delete the yarn.lock, then install the package manually using:
npm i @frontendmasters/pet

Related parcel issue: parcel-bundler/parcel#2117

It seems because I have yarn installed it uses that, even though it can see I have a package-lock.json in my project. So it assumed based on me having yarn installed rather than my specific project config, which seems wrong to me.

@plinnegan plinnegan changed the title Parcel installs with yarn not npm causing errors Parcel auto installs packages with yarn not npm causing errors May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant