Gatsby: Error: Cannot find module '../utils/test-require-error'

Created on 15 Aug 2017  ·  6Comments  ·  Source: gatsbyjs/gatsby

Hi all,

I'm following the guide and run these commands:

npm install --global gatsby-cli
gatsby new gatsby-site

And I get:

module.js:487
    throw err;
    ^

Error: Cannot find module '../utils/test-require-error'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/opt/nvm/versions/node/v8.1.4/lib/node_modules/gatsby-cli/index.js:105:24)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

I'm using Node v8.1.4 (NPM v5.0.3)

Any ideas?

Thanks!

All 6 comments

Ugh missed that in my recent PR :-( will push a fix pronto. Thanks for reporting!

Ok, run npm install -g gatsby-cli@latest and you should be fine!

@KyleAMathews thanks for the quick fix!

I now get:

There is an error in your site's package.json { Error: Cannot find module '/Users/nicolassharp/Documents/Projects/package.json'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/opt/nvm/versions/node/v8.1.4/lib/node_modules/gatsby-cli/index.js:111:22)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3) code: 'MODULE_NOT_FOUND' }

Hmmm ok quick fixes maybe should be a little less quick. Lemme fix this one too 🤦‍♂️

Ok new version is out and not broken again 🥇

@KyleAMathews Awesome, all looking good! Thanks! Looking forward to getting stuck in.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbrandin picture timbrandin  ·  3Comments

totsteps picture totsteps  ·  3Comments

theduke picture theduke  ·  3Comments

Oppenheimer1 picture Oppenheimer1  ·  3Comments

jimfilippou picture jimfilippou  ·  3Comments