btholt / btholt/complete-intro-to-react-v5

Parcel auto installs packages with yarn not npm causing errors

Open
#91 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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 0f7977ae3ce923ecf7094b82056a809fcaf1e905
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](https://github.com/btholt/complete-intro-to-react-v5/files/4645248/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: https://github.com/parcel-bundler/parcel/issues/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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce from commit 0f7977ae3ce923ecf7094b82056a809fcaf1e905 using the listed npm install and npm run dev steps, then inspect the attached err.log. Read the related Parcel issue to determine whether the behavior belongs in this repository or Parcel; done means the ownership and next action are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.