📢 Moved to Payload Monorepo 📢
payloadcms / create-payload-app Goto Github PK
View Code? Open in Web Editor NEWCLI for creating a new Payload project
CLI for creating a new Payload project
📢 Moved to Payload Monorepo 📢
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 [email protected]
npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/local/opt/[email protected]/bin/python3.10"
npm ERR! gyp info spawn /usr/local/opt/[email protected]/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
The blog
template uses a good ol' select
field instead of using the built-in Draft functionality.
When creating the website template it installs the expect version of Payload: 2.0.3.
I pushed this to my repo and then came back to play around later, but on a different PC.
Running npm i
causes Payload 1.15.8 to be installed.
It looks like a peer dependency issue as manually telling npm to load payload 2.0.3 gives a bunch of warnings:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/payload
npm WARN peer payload@">= 1.8.2" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-cloud
npm WARN @payloadcms/plugin-cloud@"^2.0.0" from the root project
npm WARN 5 more (@payloadcms/plugin-form-builder, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-form-builder
npm WARN @payloadcms/plugin-form-builder@"^1.0.13" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/payload
npm WARN peer payload@">= 1.8.2" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-cloud
npm WARN @payloadcms/plugin-cloud@"^2.0.0" from the root project
npm WARN 5 more (@payloadcms/plugin-form-builder, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-nested-docs
npm WARN @payloadcms/plugin-nested-docs@"^1.0.4" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/payload
npm WARN peer payload@">= 1.8.2" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-cloud
npm WARN @payloadcms/plugin-cloud@"^2.0.0" from the root project
npm WARN 5 more (@payloadcms/plugin-form-builder, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-redirects
npm WARN @payloadcms/plugin-redirects@"^1.0.0" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/payload
npm WARN peer payload@">= 1.8.2" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-cloud
npm WARN @payloadcms/plugin-cloud@"^2.0.0" from the root project
npm WARN 5 more (@payloadcms/plugin-form-builder, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer payload@"^0.18.5 || ^1.0.0" from @payloadcms/[email protected]
npm WARN node_modules/@payloadcms/plugin-seo
npm WARN @payloadcms/plugin-seo@"^1.0.10" from the root project
added 7 packages, removed 3 packages, changed 7 packages, and audited 1248 packages in 29s
Steps to reproduce:
npm install
Files attached for your viewing pleasure:
The templates have a yarn.lock
file by design in order to be stable for payload cloud.
However, this means that anyone using create-payload-app
will also be getting whatever payload version is specified in the yarn-lock file when they're expecting to get latest.
In order for a user to use latest Payload is to do explicitly update Payload to latest.
I think this issue should be opened here so here we go.
When creating a new payload app, the package.json version defaults to ^latest version whatever
.
The issue happened when i had a 1.4.1 payload app that somehow i deleted the yarn.lock/node_modules and needed a fresh yarn install
.
This allowed yarn to match payload version to the latest 1.7.2 which has many breaking changes and failed to build the app.
I think each project should be generated with semver syntax like this ~payload version
to update to the latest patch version only since there is breaking changes with each minor version.
Hi
I wonder if this issue only happens on my machine, but I could reproduce it repeatedly.
Steps to reproduce it:
npx create-payload-app my-payload-project
cd my-payload-project yarn dev
yarn add pino-pretty scheduler yarn dev
process
as dev dependenciesprocess
as dev dependencyAfter that, is seemed to work fine, didn't make an extensive test.
Env:
OS: Mac Ventura 13.0.1
arch: M1 (arm64)
node:v18.14.0
yarn:3.4.1
npm: 9.5.1
nvm: 0.39.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.