Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new project fails with starter template #8595

Closed
aalokt89 opened this issue Sep 27, 2018 · 9 comments
Closed

Creating a new project fails with starter template #8595

aalokt89 opened this issue Sep 27, 2018 · 9 comments

Comments

@aalokt89
Copy link

Whenever I try to create a new project via the cli, I get an error and it fails to complete. This was working fine yesterday, but I cannot get it to work at all now (I haven't changed anything from yesterday to today). I already have the cli successfully installed.

Steps to reproduce

  • Uninstalled cli: npm uninstall --global gatsby-cli
  • Reinstalled cli: npm install --global gatsby-cli success.
  • create new project: gatsby new [project-name]
  • received this error
error webpack-dev-server@3.1.9: The engine "node" is incompatible with this module. Expected version ">= 6.11.5". Got "6.9.5"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed: yarnpkg

Expected result

Project should be built successfully.

Actual result

the full error I receive while gatsby is creating my project:

Aaloks-MacBook-Pro-2:~ aaloktrivedi$ gatsby new gatsby-portfolio
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'gatsby-portfolio'...
remote: Enumerating objects: 924, done.
remote: Total 924 (delta 0), reused 0 (delta 0), pack-reused 924
Receiving objects: 100% (924/924), 1.01 MiB | 6.61 MiB/s, done.
Resolving deltas: 100% (531/531), done.
success Created starter directory layout
info Installing packages...
yarn install v1.10.1
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error webpack-dev-server@3.1.9: The engine "node" is incompatible with this module. Expected version ">= 6.11.5". Got "6.9.5"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed: yarnpkg


  Error: Command failed: yarnpkg
  
  - index.js:236 Promise.all.then.arr
    [lib]/[gatsby-cli]/[execa]/index.js:236:11
  
  - util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23
  
  - promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31
  
  - promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18
  
  - promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10
  
  - promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
  
  - promise.js:638 Promise._fulfill
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18
  
  - promise_array.js:126 PromiseArray._resolve
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19
  
  - promise_array.js:144 PromiseArray._promiseFulfilled
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14
  
  - promise.js:574 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26
  
  - promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10
  
  - promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
  
  - async.js:138 _drainQueueStep
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12
  
  - async.js:131 _drainQueue
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:131:9
  
  - async.js:147 Async._drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:147:5
  
  - async.js:17 Immediate.Async.drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14

Environment


  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 6.9.5 - /usr/local/bin/node
    Yarn: 1.10.1 - /usr/local/bin/yarn
    npm: 3.10.10 - /usr/local/bin/npm
  Browsers:
    Chrome: 69.0.3497.100
    Firefox: 62.0
    Safari: 12.0
  npmGlobalPackages:
    gatsby-cli: 2.4.2
@LekoArts
Copy link
Contributor

error webpack-dev-server@3.1.9: The engine "node" is incompatible with this module. Expected version ">= 6.11.5". Got "6.9.5"

The first line of your error already tells you what's the issue here. Your node version is outdated. The current LTS version is 8.12 and you can download it here

@aalokt89
Copy link
Author

lol yup I updated right after and it's working now. npm noob... carry on, nothing to see here!

@LekoArts
Copy link
Contributor

Cool!

@gilbertlucas46
Copy link

Hi I have the same issue, I updated my Node & NPM to latest version but I still get the error

error /Users/admin/Documents/projects/gilbert/node_modules/sharp: Command failed. Exit code: 1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) Arguments: Directory: /Users/admin/Documents/projects/gilbert/node_modules/sharp Output: info sharp Using cached /Users/admin/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz ERR! sharp zlib: unexpected end of file info sharp Attempting to build from source via node-gyp but this may fail due to the above error info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@11.10.0 | darwin | x64 gyp http GET https://nodejs.org/download/release/v11.10.0/node-v11.10.0-headers.tar.gz gyp http 200 https://nodejs.org/download/release/v11.10.0/node-v11.10.0-headers.tar.gz gyp http GET https://nodejs.org/download/release/v11.10.0/SHASUMS256.txt gyp http 200 https://nodejs.org/download/release/v11.10.0/SHASUMS256.txt gyp info spawn /usr/bin/python gyp info spawn args [ '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/Users/admin/Documents/projects/gilbert/node_modules/sharp/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/admin/.node-gyp/11.10.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/admin/.node-gyp/11.10.0', gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/admin/.node-gyp/11.10.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/Users/admin/Documents/projects/gilbert/node_modules/sharp', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o ../src/common.cc:25:10: fatal error: 'vips/vips8' file not found #include <vips/vips8> ^~~~~~~~~~~~ 1 error generated. make: *** [Release/obj.target/sharp/src/common.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/admin/Documents/projects/gilbert/node_modules/sharp

error Command failed: yarnpkg

Error: Command failed: yarnpkg

  • index.js:236 Promise.all.then.arr
    [lib]/[gatsby-cli]/[execa]/index.js:236:11

  • util.js:16 tryCatcher
    [lib]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23

  • promise.js:512 Promise._settlePromiseFromHandler
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31

  • promise.js:569 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18

  • promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  • promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  • promise.js:638 Promise._fulfill
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18

  • promise_array.js:126 PromiseArray._resolve
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19

  • promise_array.js:144 PromiseArray._promiseFulfilled
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14

  • promise.js:574 Promise._settlePromise
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26

  • promise.js:614 Promise._settlePromise0
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  • promise.js:694 Promise._settlePromises
    [lib]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  • async.js:138 _drainQueueStep
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:138:12

  • async.js:131 _drainQueue
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:131:9

  • async.js:147 Async._drainQueues
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:147:5

  • async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [lib]/[gatsby-cli]/[bluebird]/js/release/async.js:17:14`

@josefaidt
Copy link
Contributor

@gilbertlucas46 can you comment the output of gatsby info --clipboard?

@gilbertlucas46
Copy link

Hi @josefaidt here it is

I used the exact version of NODE and NPM recommended by Gatsby
https://www.gatsbyjs.org/static/9b2d2f490c2b7a1b7e0d84da65674648/95e0d/01-node-npm-versions.png

System:
OS: macOS 10.14.1
CPU: (4) x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.2.0 - /usr/local/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 72.0.3626.109
Firefox: 65.0.1
Safari: 12.0.1
npmGlobalPackages:
gatsby-cli: 2.4.11

@gilbertlucas46
Copy link

@josefaidt fixed it by rm /Users/admin/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz

@josefaidt
Copy link
Contributor

Yup, I was going to recommend npm cache clear or yarn cache clear. Good to hear!

@selipso
Copy link

selipso commented May 17, 2019

Updating your node.js version was my solution to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants