Installation fails
Installing on Ubuntu 22.04, following instructions here https://github.com/NASA-SW-VnV/fret/blob/master/fret-electron/docs/_media/installingFRET/installationInstructions.md, fails with
npm ERR! code 1
npm ERR! path /XXXXXXXXX/fret/fret-electron/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.mjs
npm ERR! file:///XXXXXXXXX/node_modules/puppeteer/install.mjs:31
npm ERR! const {downloadBrowser} = await importInstaller();
npm ERR! ^^^^^
npm ERR!
npm ERR! SyntaxError: Unexpected reserved word
npm ERR! at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
npm ERR! at async link (internal/modules/esm/module_job.js:42:21)
Hi @dgenin ,
Thanks for checking out FRET! Usually, when something goes wrong during the installation, a log file is generated that contains additional information. Was one generated for you? If so, would it be possible to share its contents with us?
The snippet you included seems to suggest something going wrong during the installation of the puppeteer package, but we cannot say for sure what the cause is if we do not have a few more details. The log file will help as a first step.
Best Regards,
Andreas
I think i was using a version of Node.js that was too old. After upgrading i'm now getting a different error.
> [email protected] build-dll
> cross-env NODE_ENV=development node --trace-warnings -r @babel/register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js
sh: 1: cross-env: Permission denied
npm error code 126
npm error path /home/XXXXXXXXX/fret/fret-electron
npm error command failed
npm error command sh -c node -r @babel/register internals/scripts/CheckNativeDep.js && npm run flow-typed && npm run build-dll && electron-builder install-app-deps && node node_modules/fbjs-scripts/node/check-dev-engines.js package.json
Yes, using a wrong NodeJS version is the most common culprit, from our experience.
Given that, if you look at the log file you shared with us, you'll notice that the version that you used (v20.15.1) is outside of the range of versions that (we know) we support (v16.16.x - v20.13.1).
So my current suggestion is to make sure that you are using a version within the aforementioned supported range. If you need to use other versions of node in the same system, the most convenient way to manage this is by using nvm. Assuming that you have nvm installed, you can then follow the steps below to switch to a compatible version:
- Install compatible version
nvm install v20.13.1
- Switch to installed version
nvm use v20.13.1
- Verify that the installed version will be used
node -v
- If not there yet, change directory to your
fret/fret-electronfolder and attempt to install from scratch
npm run fret-reinstall
Let us know how it goes!
Andreas
Success! Thank you!