Gatsby: "A local install of Gatsby was not found. You should save Gatsby as a site dependency" โ€” Issues with gatsby npm package

Created on 13 Oct 2017  ยท  16Comments  ยท  Source: gatsbyjs/gatsby

Version Details:
Gatsby Version: 1.8.12
macOS Version: 10.12.6 (16G29)
Node Version: v7.9.0

Gists:
gatsby-config.js
package.json
gatsby-node.js

โ€”

Hello!

I've recently tried cloning a repo of a personal website which was built using the gatsby starter for a blog with no styles.

As you'll see below, after cloning the repo to a new machine that has gatsby globally installed, I attempted to npm install and get started working, but I received the following error:

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js'

After seeing this, I attempted to gatsby develop anyways, but encountered this error:

A local install of Gatsby was not found. You should save Gatsby as a site dependency e.g. npm install --save gatsby

Following those instructions, I input npm install --save gatsby and received the same error as before:

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js' npm ERR! enoent This is most likely not a problem with npm itself

I've included the full log of what appeared in my terminal below

โ€”

EdBookPro:edouerd.github.com edouard$ npm install

npm WARN deprecated [email protected]: ๐Ÿ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env o update!
npm WARN prefer global [email protected] should be installed with -g
[email protected] /Users/edouard/Desktop/ed test/edouerd.github.com


huge ass tree of packages is here, visit this gist if you actually need to see this part: https://gist.github.com/edouerd/44e4f1ce2b9e6dfb078b1951fb2ad7ab


npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/edouard/.nvm/versions/node/v7.9.0/bin/node" "/Users/edouard/.nvm/versions/node/v7.9.0/bin/npm" "install"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! path /Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/edouard/.npm/_logs/2017-10-13T02_02_12_324Z-debug.log

EdBookPro:edouerd.github.com edouard$ gatsby develop
A local install of Gatsby was not found.
You should save Gatsby as a site dependency e.g. npm install --save gatsby

EdBookPro:edouerd.github.com edouard$ npm install --save gatsby

npm WARN deprecated [email protected]: ๐Ÿ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env o update!
npm WARN prefer global [email protected] should be installed with -g
npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/edouard/.nvm/versions/node/v7.9.0/bin/node" "/Users/edouard/.nvm/versions/node/v7.9.0/bin/npm" "install" "--save" "gatsby"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! path /Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/edouard/Desktop/ed test/edouerd.github.com/node_modules/gatsby/bin/gatsby.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/edouard/.npm/_logs/2017-10-13T02_05_29_415Z-debug.log

EdBookPro:edouerd.github.com edouard$ gatsby develop

A local install of Gatsby was not found.
stale? question or discussion

All 16 comments

Just ran into this issue as well, using yarn install instead of npm install seems to be a good workaround for now

Not a good start in the day... npm update gave me the same error i think...

npm update
npm WARN deprecated [email protected]: We're super ๐Ÿ˜ธ  excited that you're trying to use ES2015 syntax, but instead of continuing yearly presets ๐Ÿ˜ญ , we recommend using babel-preset-env: npm install babel-preset-env. preset-env without options will compile ES2015+ down to ES5. And by targeting specific browsers, Babel can do less work and you can ship native ES2015+ to users ๐Ÿ˜Ž ! Also, we are in the process of releasing v7, so give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and test it! Thanks so much for using Babel ๐Ÿ™ , please give us a follow @babeljs for updates, join slack.babeljs.io for discussion and help support at opencollective.com/babel
npm WARN 360vier@ No repository field.

npm ERR! path /Users/felix/Documents/360vier/node_modules/gatsby/bin/gatsby.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/felix/Documents/360vier/node_modules/gatsby/bin/gatsby.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/felix/.npm/_logs/2017-10-13T06_27_43_858Z-debug.log

dont know why it deletes the gatsby package - please fix :)

@daviddeejjames no upgrade error with yarn... thank you! I should use this for now on...

Yeah, just use Yarn.

You may run into the same error with Yarn lower or equal to 0.18.x Using Yarn latest (atm 0.27.5) is a good idea.

Running into this issue this morning using yarn 1.2.1 after updating my dependencies.

It does not happen if I roll back to Gatsby 1.9.50 (but then I get API mismatch with other dependencies...)

happens to me as well on yarn 1.2.1 with [email protected]

Could y'all try upgrading your global gatsby-cli package?

Updgrading global gatsby-cli didn't work as is but when I tried to remove it I got a yarn error This module isn't specified in a manifest. I guess I had it installed with npm.
Removing the global gatsby-cli and global gatsby with npm and reinstall global gatsby-cli with yarn fixed it for me.
yarn 1.2.1
gatsby 1.9.80
gatsby-cli 1.1.11

As MarcCoet pointed out, installing gatsby with yarn would make things work like a charm. And then simply run via yarn build

I'm having the same issue. I've tried yarn and I've updated to current cli.

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub issues, we have to clean some of the old issues as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Gatsby version and check if that solves the issue. Let us know if that works for you by adding a comment ๐Ÿ‘

This seems to be an issue with using system node vs. using a release of node with nvm. Running nvm use v8.9.4 fixes for me.

This seems to be an issue with using system node vs. using a release of node with nvm. Running nvm use v8.9.4 fixes for me.

@edouerd can you try the suggestion provided by @danrosenthal?

This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  ยท  3Comments

benstr picture benstr  ยท  3Comments

totsteps picture totsteps  ยท  3Comments

kalinchernev picture kalinchernev  ยท  3Comments

rossPatton picture rossPatton  ยท  3Comments