Skip to main content

Strapi Update

### Update Ubuntu packagelist / Repository list
- root: apt update

### Update node & npm
## Update node to latest LTS
# https://askubuntu.com/questions/1265813/how-to-update-node-js-to-the-long-term-support-version-on-ubuntu-20-04
- root: curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
- root: apt-get install -y nodejs


### Strapi Update
Service stoppen (awg-api service):
- root: pm2 ls
- root: pm2 stop [name]

Linux User: awg-api (cd DocumentRoot):
vorgehensweiße wie in den docs von strapi update (https://docs.strapi.io/dev-docs/update-version)
Check https://www.npmjs.com/ for package.json updates (dependencies)

danach:
- root: pm2 start [name] --watch (<= [name] der name den du vorher gestoppt hast)

Wenn Fehler bei npm install:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
Dann die Version in die package.json schreiben die strapi haben will, z. B.:
npm ERR! node_modules/@strapi/plugin-users-permissions
npm ERR!   @strapi/plugin-users-permissions@"4.23.1" from the root project


##### (optional) Update node version:
Bei awg-api | rbo - wabenplan:
- awg-api: volta install node@[version] (e. g. volta install node@20)
- root: cd /etc/pm2/sites/pm2.awg-api.json <- node Version austauschen (pfad)