LinuxForHealth/FHIR

Project (docs) site build is failing

Opened this issue · 1 comments

Describe the bug
The project website is no longer building.

[4/4] Building fresh packages...
error /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/node-sass
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Output:
Building: /opt/hostedtoolcache/node/18.12.1/x64/bin/node /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/opt/hostedtoolcache/node/18.12.1/x64/bin/node',
gyp verb cli   '/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@18.12.1 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:89:16
gyp verb `which` failed     at /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:207:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/which/which.js:89:16
gyp verb `which` failed     at /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:207:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:412:12)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
gyp ERR! System Linux 5.15.0-1024-azure
gyp ERR! command "/opt/hostedtoolcache/node/18.12.1/x64/bin/node" "/home/runner/work/FHIR/FHIR/fhir/docs/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/runner/work/FHIR/FHIR/fhir/docs/node_modules/node-sass
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1

Environment
Which version of LinuxForHealth FHIR Server?

To Reproduce
Steps to reproduce the behavior:

  1. make a change to the docs
  2. merge the change into master

note the build failure

Expected behavior
docs site should update on each commit that includes a change to docs

Additional context
Previously we were getting errors related to our outdated Node.js.
I think these errors started after I tried bumping that version to a LTS release.
Needs investigation.

Tried adding .npmrc file in the project folder containing python = "/usr/bin/python2.7" but still seeing the same error as above. The common suggestion to fix the above error is to update the node-sass version which supports node 18 as mentioned in below link.
https://www.npmjs.com/package/node-sass