Forums | Mahara Community

Support /
Help Upgrading from 22.10 to 24.04 git


Doris ⚡'s profile picture
Posts: 99

19 June 2024, 10:12

Hi Anthony,

Yay. Well done on getting Mahara 24.04 up and running! 🙌

If it helps for you to remember, you can create a CUSTOMISATIONS.md file (there is an example at the root directory of Mahara you can copy) to note the extra step of manually updating the php calls to be php8.3 for when you next update or upgrade the site.

Kind regards,

Doris

20 June 2024, 0:36

Gah!! i spoke too soon tried the upgrade again just to make sure (this is on our test system as the production upgrade is set for the 30th) 

Tried the upgrade again when i did a make css after i did the git pull i got this error 

 

make initcomposer ran without any issues 

 

-----------------------------------------
INSTALLING PACKAGES...
-----------------------------------------
Found '/srv/www/mahara/.nvmrc' with version <16>
v16.20.2 is already installed.
Now using node v16.20.2 (npm v8.19.4)
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

> [email protected] postinstall
> patch-package --patch-dir=./patches/

/srv/www/mahara/node_modules/yaml/dist/compose/composer.js:33
                if (prelude[i + 1]?.[0] !== '#')
                                   ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:85:18)
    at Object.<anonymous> (/srv/www/mahara/node_modules/yaml/dist/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! code 1
npm ERR! path /srv/www/mahara
npm ERR! command failed
npm ERR! command sh -c -- patch-package --patch-dir=./patches/

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-06-19T12_31_22_109Z-debug-0.log
make: *** [Makefile:128: css] Error 1

Doris ⚡'s profile picture
Posts: 99

20 June 2024, 9:45

Hi Anthony,

For major upgrades, there can be code conflicts in lock files because we upgraded third-party libraries.

See if the following steps help:

  1. Delete the `node_modules` folder
  2. Override the content in `package-lock.json` with the 24.04_STABLE version or for the respective branch your code is from
  3. Run `make css` again

Kind regards,

Doris

21 June 2024, 4:29

Still getting the error These are the commands i used 

 

switched to 24_04 branch in git

git pull
git branch -a
git checkout 24.04_STABLE

deleted the node_modules folder 

(wasnt sure what you mean by the versions in my package-lock.json file im just using the one that comes with git) 


nvm install v18.17.0
npm install -g [email protected]
npm install --global gulp
npm cache clean -f

chown -R www-data. patches/


npm rebuild node-sass (works)
make initcomposer (works) 
make css

ERROR: 

 

npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

> [email protected] postinstall
> patch-package --patch-dir=./patches/

/srv/www/mahara/node_modules/yaml/dist/compose/composer.js:33
                if (prelude[i + 1]?.[0] !== '#')
                                   ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:85:18)
    at Object.<anonymous> (/srv/www/mahara/node_modules/yaml/dist/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! code 1
npm ERR! path /srv/www/mahara
npm ERR! command failed
npm ERR! command sh -c -- patch-package --patch-dir=./patches/

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-06-20T16_27_10_397Z-debug-0.log
make: *** [Makefile:128: css] Error 1

21 June 2024, 4:42

Actually i think i just solved it i think it was permissions www-data wasnt owner of a few of the dirs so i think thats what the issue was im going to roll back again and try the upgrade one more time i think thats it as our test site upgraded there a sec ago i'll keep you posted but i think thats what it was 

25 June 2024, 2:39

sadly still running into issues get as far as trying to run make css then it crashes out 

These are the updates im running 

delete node_modules folder and delete package-lock.json file then run 

nvm install v18.17.0
npm install -g [email protected]
npm install -g gulp

npm rebuild node-sass

sudo -u www-data make initcomposer 

sudo -u www-data make css

I get most of the way there until it gets too 

 

-----------------------------------------
ORGANISING JS DEPENDENCIES...
-----------------------------------------
Found '/srv/www/mahara/.nvmrc' with version <16>
v16.20.2 is already installed.
Now using node v16.20.2 (npm v8.19.4)
[15:35:32] Unsupported gulp version
make: *** [Makefile:134: css] Error 1

 

not sure what the issue could be, Im upgrading from very old versions of node gulp and npm. 

 

Doris ⚡'s profile picture
Posts: 99

25 June 2024, 9:23

Hi Anthony,

Please replace the contents of package-lock.json with that is on 24.04_STABLE before running make css.

This is so npm will install the versions we expect, rather than the latest versions. Particularly gulp, which mostly recently released a major version what 24.04_STABLE does not support.

Kind regards,

Doris

12 August 2024, 20:47

Hi Doris

            sorry for taking so long to get back to you. I actually though the upgrade was successful but i wasnt. When i went back to try the upgrade again. I didnt in fact replace the contents of package-lock.json on 24_04 stable before i ran make css. However i did that and im still getting an error. 

So i replaced the file I get all the way to the end i run make css and i get this error: 

 

npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

> [email protected] postinstall
> patch-package --patch-dir=./patches/

/srv/www/maharatest/node_modules/yaml/dist/compose/composer.js:33
                if (prelude[i + 1]?.[0] !== '#')
                                   ^

SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/srv/www/maharatest/node_modules/yaml/dist/index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
npm ERR! code 1
npm ERR! path /srv/www/maharatest
npm ERR! command failed
npm ERR! command sh -c -- patch-package --patch-dir=./patches/

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-08-12T08_36_01_681Z-debug-0.log
make: *** [Makefile:128: css] Error 1

 

When i check the log file:  /root/.npm/_logs/2024-08-12T08_36_01_681Z-debug-0.log this is at the end: 

 

 

2142 timing build:run:postinstall:node_modules/@babel/polyfill/node_modules/core-js Completed in 655ms
2143 timing build:run:postinstall Completed in 3514ms
2144 timing build:deps Completed in 3601ms
2145 timing build Completed in 3601ms
2146 timing reify:build Completed in 3603ms
2147 timing reify:trash Completed in 3ms
2148 timing reify:save Completed in 290ms
2149 timing reify Completed in 55648ms
2150 timing command:install Completed in 56443ms
2151 verbose stack Error: command failed
2151 verbose stack     at ChildProcess.<anonymous> (/root/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
2151 verbose stack     at ChildProcess.emit (node:events:513:28)
2151 verbose stack     at maybeClose (node:internal/child_process:1100:16)
2151 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
2152 verbose pkgid [email protected]
2153 verbose cwd /srv/www/maharatest
2154 verbose Linux 5.4.0-189-generic
2155 verbose node v16.20.2
2156 verbose npm  v8.19.4
2157 error code 1
2158 error path /srv/www/maharatest
2159 error command failed
2160 error command sh -c -- patch-package --patch-dir=./patches/
2161 verbose exit 1
2162 timing npm Completed in 56611ms
2163 verbose code 1
2164 error A complete log of this run can be found in:
2164 error     /root/.npm/_logs/2024-08-12T08_36_01_681Z-debug-0.log

 

Im not sure what the issue could be. 

 

Anthony. 

12 August 2024, 21:55

Just looking at the logs again and im wondering Is it something to do with a version of node or NVM im running by any chance? 

Doris ⚡'s profile picture
Posts: 99

13 August 2024, 9:30

Hi Anthony,

I managed to replicate the issue you are getting when I run 'npm install' on node version 12.

Can you please run 'nvm current' in your terminal to see what version of node is being used?

I have attached what I'm expecting when running make css. Is that what you get?

Kind regards,

Doris

 

  • 2404_stable_expected_makecss.txt