Development on Fedora 35

Hi everyone,
recently updated my workstation to Fedora 35 and it went pretty smoothly except one small detail and - it broke my DEV environment, in particular npm install :wink:

When I do the cleanup:
rm -rf node_modules package-json.lock tmp/*;npm cache clean --force;
& run the npm install I got this error:

While resolving: TheForemanDevDeps@3.2.0
Found: react-dnd-test-backend@9.5.1
node_modules/react-dnd-test-backend
  dev react-dnd-test-backend@"^9.4.0" from the root project

Could not resolve dependency:
peer react-dnd-test-backend@"^7.2.0" from react-dnd-test-utils@9.5.1
node_modules/react-dnd-test-utils
  dev react-dnd-test-utils@"^9.4.0" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Full log: https://pastebin.com/uL8hqVwq

Running npm install --legacy-peer-deps seems to be working but I ended with different error:

npm ERR! code 1
npm ERR! path /home/lstejskal/Projects/foreman/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/bin/node /home/lstejskal/Projects/foreman/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   '/usr/bin/node',
npm ERR! gyp verb cli   '/home/lstejskal/Projects/foreman/node_modules/node-gyp/bin/node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.0 | linux | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "/usr/bin/python3" in the PATH
npm ERR! gyp verb `which` succeeded /usr/bin/python3 /usr/bin/python3
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack 
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Linux 5.15.14-200.fc35.x86_64
npm ERR! gyp ERR! command "/usr/bin/node" "/home/lstejskal/Projects/foreman/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/lstejskal/Projects/foreman/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

I can take care about the fix and push the PRs but honestly I have no idea where to begin so any help would be deeply appreciated.

foreman can’t work yet on node 16 ):

1 Like

Thanks Maria, I’ll try to downgrade node to v14 and I try it again

For what it’s worth, you can enable the Node 14 module in Fedora 35:

dnf module enable nodejs:14

If you already have the nodejs package installed:

dnf downgrade nodejs