payloadcms / create-payload-app

CLI for creating a new Payload project
12 stars 8 forks source link

Fails to install dependencies (fatal error: 'vips/vips8' file not found) #17

Closed jamesvclements closed 1 year ago

jamesvclements commented 1 year ago

Having trouble getting npx create-payload-app to install dependencies, automatically and it fails if I manually try to npm i after creation. I'm on Node 18.16.0, NPM 9.5.1.

✔ Project directory created
✖ Error installing dependencies
✔ .env file created
✔ Payload project successfully created

It seems to be an issue with the sharp package and vips/vips8 (output from npm i):

npm ERR! code 1
npm ERR! path /Users/james/Local/Projects/Projects : Client/Paper Triangles – Portfolio/paper-triangles-cms/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Using cached /Users/james/.npm/_libvips/libvips-8.13.3-darwin-x64.tar.br
npm ERR! sharp: Integrity check passed for darwin-x64
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   TOUCH Release/obj.target/libvips-cpp.stamp
npm ERR!   CXX(target) Release/obj.target/sharp-darwin-x64/src/common.o
npm ERR! sh: prebuild-install: command not found
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.3.1
npm ERR! gyp info using node@18.16.0 | darwin | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/local/opt/python@3.10/bin/python3.10"
npm ERR! gyp info spawn /usr/local/opt/python@3.10/bin/python3.10
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/james/.nvm/versions/node/v18.16.0/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   '/Users/james/Local/Projects/Projects : Client/Paper Triangles – Portfolio/paper-triangles-cms/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/james/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/james/Library/Caches/node-gyp/18.16.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=/Users/james/Library/Caches/node-gyp/18.16.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/james/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/james/Library/Caches/node-gyp/18.16.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/james/Local/Projects/Projects : Client/Paper Triangles – Portfolio/paper-triangles-cms/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! warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! ../src/common.cc:24:10: fatal error: 'vips/vips8' file not found
npm ERR! #include <vips/vips8>
npm ERR!          ^~~~~~~~~~~~
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sharp-darwin-x64/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 (/Users/james/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 22.2.0
npm ERR! gyp ERR! command "/Users/james/.nvm/versions/node/v18.16.0/bin/node" "/Users/james/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/james/Local/Projects/Projects : Client/Paper Triangles – Portfolio/paper-triangles-cms/node_modules/sharp
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/james/.npm/_logs/2023-06-20T16_09_35_838Z-debug-0.log
denolfe commented 1 year ago

I'm not able to replicate this with exact versions of node and npm on my M2 macbook.

What mac version and architecture?

jamesvclements commented 1 year ago

This is an issue with Sharp and / in the directory name