fabe / gatsby-universal

🔮 An opinionated Gatsby v2 starter for state-of-the-art marketing sites.
https://gatsby-universal.netlify.com
MIT License
614 stars 96 forks source link

Error on NPM/Yarn Install #76

Open rykener opened 3 years ago

rykener commented 3 years ago
➜ npm --version
7.3.0
➜  node --version
v15.5.1
➜  gatsby --version
Gatsby CLI version: 2.17.0
$ gatsby new my-project git@github.com:fabe/gatsby-universal.git
info Creating new site from git: https://github.com/fabe/gatsby-universal.git

Cloning into 'UnpopularCool'...
remote: Enumerating objects: 91, done.
remote: Counting objects: 100% (91/91), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 91 (delta 0), reused 50 (delta 0), pack-reused 0
success Created starter directory layout
info Installing packages...

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: eslint@5.16.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^5.12.1" from the root project
npm ERR!   peer eslint@">= 4.12.1" from babel-eslint@10.1.0
npm ERR!   node_modules/babel-eslint
npm ERR!     dev babel-eslint@"^10.0.1" from the root project
npm ERR!     babel-eslint@"^10.1.0" from gatsby@2.31.1
npm ERR!     node_modules/gatsby
npm ERR!       gatsby@"^2.3.26" from the root project
npm ERR!   6 more (eslint-config-prettier, eslint-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev gatsby-plugin-eslint@"^2.0.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint@6.8.0
npm ERR! node_modules/eslint
npm ERR!   peer eslint@"^6.6.0" from gatsby-plugin-eslint@2.0.8
npm ERR!   node_modules/gatsby-plugin-eslint
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/<redacted>/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

 ERROR

Command failed with exit code 1: npm install

  Error: Command failed with exit code 1: npm install

  - error.js:56 makeError
    [lib]/[gatsby-cli]/[execa]/lib/error.js:56:11

  - index.js:114 handlePromise
    [lib]/[gatsby-cli]/[execa]/index.js:114:26

  - task_queues:93 processTicksAndRejections
    node:internal/process/task_queues:93:5

  - init-starter.js:135 install
    [lib]/[gatsby-cli]/lib/init-starter.js:135:7

  - init-starter.js:202 clone
    [lib]/[gatsby-cli]/lib/init-starter.js:202:3

  - init-starter.js:343 initStarter
    [lib]/[gatsby-cli]/lib/init-starter.js:343:5

  - create-cli.js:485
    [lib]/[gatsby-cli]/lib/create-cli.js:485:9

When cloning from github and then running npm i

npm ERR! code 1
npm ERR! path /Users/<redacted>/source/UnpopularCool/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR!   CXX(target) Release/obj.target/sharp/src/metadata.o
npm ERR!   CXX(target) Release/obj.target/sharp/src/stats.o
npm ERR! info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-darwin-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.5.1 | darwin | x64
npm ERR! gyp info spawn /usr/bin/python2
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/<redacted>/source/UnpopularCool/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/<redacted>/source/UnpopularCool/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/<redacted>/source/UnpopularCool/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/<redacted>/.node-gyp/15.5.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/<redacted>/.node-gyp/15.5.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/<redacted>/source/UnpopularCool/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/<redacted>/.node-gyp/15.5.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/<redacted>/source/UnpopularCool/node_modules/sharp',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/stats.cc:130:19: error: no matching member function for call to 'Set'
npm ERR!         channels->Set(i, channelStat);
npm ERR!         ~~~~~~~~~~^~~
npm ERR! /Users/<redacted>/.node-gyp/15.5.1/include/node/v8.h:3716:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                     ^
npm ERR! /Users/<redacted>/.node-gyp/15.5.1/include/node/v8.h:3719:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                     ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sharp/src/stats.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/Users/<redacted>/source/UnpopularCool/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! gyp ERR! command "/usr/local/Cellar/node/15.5.1/bin/node" "/Users/<redacted>/source/UnpopularCool/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/<redacted>/source/UnpopularCool/node_modules/sharp
npm ERR! gyp ERR! node -v v15.5.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/<redacted>/.npm/_logs/2021-01-22T23_32_16_580Z-debug.log

I get similar errors with yarn install but they're way more verbose

ctekk7 commented 3 years ago

Same for me, workaround: start with netlify deploy and clone from your github