Description
Summary
Hello Gatsby core team! I think users working through the Gatsby tutorials will benefit from guidance on choosing npm
as their default package manager to select on first run of gatsby new
when starting to learn Gatsby. In addition, pointing to the page on Gatsby CLI commands will be helpful. This missing piece of info should reduce issues that occur when a user works through Tutorial Part 3 and is required to install dependencies in a project for the first time.
I'm happy to make updates to the documentation if you wish.
Some recommended topics to cover:
Motivation
Users who are brand new to using npm and/or yarn will benefit greatly from this info, here's why:
While working through the Gatsby Tutorials, I ran into an issue in Tutorial Part 3 where running gatsby develop
in the cli at step 4 of the Install and configure gatsby-plugin-typography step, and threw the following error:
Error: Cannot find module 'react'
After checking the package.json
file dependencies I ran yarn
in the cli, and then gatsby develop
. The app loaded just fine after that.
I reviewed all the tutorial steps to determine what possibly may have caused the error, and I remembered one thing: when I generated a Gastby project for the first time, I selected yarn
as my default package manager (in anticipation to working with theming and yarn workspaces later in the week).
As I was following the tutorial steps, I realized I was using npm
rather than yarn
to install the typography dependencies. I'm not fully familiar with the issues that could happen (if any) by using yarn
as your default package manager, generating gatsby projects, and then using npm
to install dependencies in the project.
However. Considering the tutorial steps are indicating we should be using npm
to install dependencies, it seems it makes sense to guide brand new users to select npm
as their default package manager during the first run of gatsby new
, yes?
Steps to resolve this issue
Draft the doc
- Write the doc, following the format listed in these resources:
- Add the article to the docs sidebar under the [parent doc] section.
Open a pull request
- Open a pull request with your work including the words "closes #[this issue's number]" in the pull request description