Can't create new Gatsby project

Viewed 1094

Create a Gatsby site from a Gatsby starter.

# install the Gatsby CLI globally
npm install -g gatsby-cli

# create a new Gatsby site using the default starter
gatsby new my-blazing-fast-site

But I've got this

error Couldn't find package "@reach/router@^1.1.1" required by "gatsby@^2.0.0" on the "npm" registry.

Error: Couldn't find package "@reach/router@^1.1.1" required by "gatsby-link@^2.0.0-rc.4" on the "npm" registry.
Error: Couldn't find package "@xtuc/ieee754@^1.2.0" required by "@webassemblyjs/ieee754@1.7.6" on the "npm" registry.
Error: Couldn't find package "@xtuc/long@4.2.1" required by "@webassemblyjs/wast-printer@1.7.6" on the "npm" registry.
Error: Couldn't find package "@xtuc/long@4.2.1" required by "@webassemblyjs/wast-parser@1.7.6" on the "npm" registry.

Error: Command failed: yarnpkg
  • macOS High Sierra 10.13.6
  • npm v5.6

Other projects/libs install without problems.

Is it problem on my side?

3 Answers
npm login

will solve the problem .

I had this issue after updating or installing mac Xcode.

Try updating to the latest node version using the following steps:

1 - uninstall Gatsby:

npm uninstall -g gatsby

2 - delete your project:

BE CAREFUL!! (-r = recursive, -f = force). This cant be undone. Alternatively you can delete the folder manually.

rm -r -f my-blazing-fast-site

3 - Update node to latest version(my latest version was v11.15.0 in this case) If you are using nvm run:

nvm ls-remote //check latest version
nvm install <version> // install
nvm use <version> // I skipped the first two steps and used my latest installed version > nvm use 11

4 - Reinstall Gatsby:

npm install -g gatsby

5 - Create a new gatsby project

gatsby new my-blazing-fast-site

BAM! You should now have successfully installed and created your project.

cd my-blazing-fast-site
gatsby develop
Related