Invalid argument exception thrown during first configuration on Node 14.x
manucuf opened this issue · comments
Issue Description
Since Node.js 14.5 has been promoted to LTS, now it's the default version downloaded from 'stable' channel. Within this version, the method writeFileSync has a data mandatory argument. https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options
In initUserRepo function declared at app/util/project_init.js, this function (line 21) was called without this mandatory argument, causing ERR_INVALID_ARG_TYPE exception and application crash.
To Reproduce
Steps to reproduce the behavior:
- Remove config/config_user.json file (to initialize the application to the first usage)
- Start the application, compile initial configuration form and click on 'Install'
- The exception is shown on the terminal, as the application crashes.
Expected behavior
Docker Security Playground configuration proceeds correctly and automatically redirects to http://localhost:8080/labs
Desktop:
- OS: Debian based Linux distro, macOS 10.15
- Browser: Chrome, Safari, Firefox
- Node.js 14.5
Hi manucuf,
I updated node to 14.5 to verify this issue and I confirm that your modification to the function in the pull request solves it
if (!fs.existsSync(dspID)) fs.writeFileSync(dspID, '');
thanks for your support