transitive-bullshit / nextjs-notion-starter-kit

Deploy your own Notion-powered website in minutes with Next.js and Vercel.
https://transitivebullsh.it/nextjs-notion-starter-kit
MIT License
6.17k stars 5.24k forks source link

Puppeteer Dependency Error #98

Closed Jkker closed 3 years ago

Jkker commented 3 years ago

Running npm install after cloning this repository results in a dependency error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: nextjs-notion-starter-kit@0.1.0
npm ERR! Found: puppeteer@5.5.0
npm ERR! node_modules/puppeteer
npm ERR!   dev puppeteer@"^5.5.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer puppeteer@"^2" from puppeteer-social-image-transitive-bs@0.8.2
npm ERR! node_modules/puppeteer-social-image-transitive-bs
npm ERR!   puppeteer-social-image-transitive-bs@"^0.8.2" from the root project
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! 

Attempting a work-around, I ran npm install --force and got this

npm ERR! code 1
npm ERR! path /home/jkker/Code/nextjs-notion-starter-kit/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/jkker/Code/nextjs-notion-starter-kit/node_modules/sharp/build'
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   AR(target) Release/obj.target/../node-addon-api/nothing.a
npm ERR!   COPY Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp/src/common.o
npm ERR! make: Leaving directory '/home/jkker/Code/nextjs-notion-starter-kit/node_modules/sharp/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@15.13.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.5 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/jkker/.npm-global/lib/node_modules/npm/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   '/home/jkker/Code/nextjs-notion-starter-kit/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/jkker/.npm-global/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/jkker/.cache/node-gyp/15.13.0/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=/home/jkker/.cache/node-gyp/15.13.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/jkker/.npm-global/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/jkker/.cache/node-gyp/15.13.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/jkker/Code/nextjs-notion-starter-kit/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/common.cc:23:10: fatal error: vips/vips8: No such file or directory
npm ERR!    23 | #include <vips/vips8>
npm ERR!       |          ^~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [sharp.target.mk:139: Release/obj.target/sharp/src/common.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 (/home/jkker/.npm-global/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.72-microsoft-standard-WSL2
npm ERR! gyp ERR! command "/usr/bin/node" "/home/jkker/.npm-global/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/jkker/Code/nextjs-notion-starter-kit/node_modules/sharp
npm ERR! gyp ERR! node -v v15.13.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

Running npm install --legacy-peer-deps produces an identical result.

transitive-bullshit commented 3 years ago

Hey @Jkker, what version of Node.js are you using?

I actually just updated the project to remove puppeteer as we really aren't using it, and it's a large, complicated dependency.

Please sync with latest and try again.

Thanks.

Jkker commented 3 years ago

Hey @Jkker, what version of Node.js are you using?

I actually just updated the project to remove puppeteer as we really aren't using it, and it's a large, complicated dependency.

Please sync with latest and try again.

Thanks.

Thanks for the reply! I am using Node v15.13.0 alongside NPM 7.9.0.

Magically, Yarn (v1.22.5) magically resolves all these dependencies errors with only a few warnings. It works for both before and after your latest commit to remove puppeteer from the deps. Unfortunately, npm i still gives an error regarding React versions.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: nextjs-notion-starter-kit@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0" from use-dark-mode@2.3.1
npm ERR! node_modules/use-dark-mode
npm ERR!   use-dark-mode@"^2.3.1" from the root project
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.

And running npm i --legacy-peer-deps or npm i --force still results in the same error when installing sharp.

npm ERR! ../src/common.cc:23:10: fatal error: vips/vips8: No such file or directory

Which is identical to what's in my first comment.

I will try again later with a different version of npm.

Thanks!

transitive-bullshit commented 3 years ago

This looks like an issue that's specific to your environment.

Feel free to add more info to this issue if you find a workaround, but otherwise I don't think we can really help, so going to close for now.

Thanks.