How to update Payload version

default discord avatar
peniswafflexd
last year
1 1

This might be a pretty noob question, but what is the best way to update the PayloadCMS version? I'm running a slightly older one and I've just tried to run npm install on my new apple silicon macbook and its failing to install node-sass.

I figure if I update to a newer release it might resolve some of these issues

UPDATE: It's not node-sass that was failing it is sharp. Here is a dump of what it says when trying to install

devon@Devons-MacBook-Pro personal-blog % npm install        
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm ERR! code 1
npm ERR! path /Users/devon/Documents/Development/Development_Backup/personal-blog/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: Detected globally-installed libvips v8.12.2
npm ERR! sharp: Building from source via node-gyp
npm ERR!   CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
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@16.14.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! (node:60026) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/devon/Documents/Development/Development_Backup/personal-blog/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/devon/Documents/Development/Development_Backup/personal-blog/node_modules/sharp/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/devon/Documents/Development/Development_Backup/personal-blog/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/devon/Library/Caches/node-gyp/16.14.2/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/devon/Library/Caches/node-gyp/16.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/devon/Documents/Development/Development_Backup/personal-blog/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/devon/Library/Caches/node-gyp/16.14.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/devon/Documents/Development/Development_Backup/personal-blog/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! env: python: No such file or directory
npm ERR! make: *** [Release/nothing.a] Error 127
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/devon/Documents/Development/Development_Backup/personal-blog/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Users/devon/Documents/Development/Development_Backup/personal-blog/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/devon/Documents/Development/Development_Backup/personal-blog/node_modules/sharp
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/devon/.npm/_logs/2022-04-04T05_26_39_754Z-debug-0.log
  • discord user avatar
    jmikrut
    Payload Team
    last year

    Hey there - yep, this is actually already fixed as of 0.13.3.

    We place a lot of emphasis on trying to minimize breaking changes as we build Payload, so upgrading to a newer (or even the newest) version of Payload should be no problem for you.

    Here is a link to our changelog, where we identify BREAKING CHANGES as we publish new minor and patch versions:

    https://github.com/payloadcms/payload/blob/master/CHANGELOG.md

    Maybe take a look through the changelog briefly to identify all breaking changes between your version and the version you'd like to update to.

    1 reply
  • discord user avatar
    DanRibbens
    Payload Team
    last year

    Some packages don't update well on occasion, if you run in to errors sometimes just blowing away node_modules and yarn.lock or package-lock.json will get you up and going again.

    rm -rf node_modules yarn.lock

    Let us know if you're still having trouble.

Open the post
Continue the discussion in GitHub
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.