Skip to content

v1.0.1

Choose a tag to compare

@divagr18 divagr18 released this 11 Jun 15:44
· 8 commits to main since this release
45cfc87

Fix: CLI Setup Command Execution Issue

What's Fixed

This release addresses a critical bug in the Cerno CLI setup process that was preventing successful installation of Node.js dependencies during the initial project setup.

Bug Description

Users were experiencing setup failures when running ./cerno migrate --verbose or ./cerno setup, with the following symptoms:

  • npm install command would fail with exit code 1
  • Setup would abort with "Failed to install Node.js dependencies" error
  • The issue occurred even when npm was properly installed and accessible

Resolution

Fixed in cerno_cli.py:

  • Improved subprocess command execution - Resolved shell command handling inconsistencies that were causing npm commands to fail
  • Enhanced error handling - Added better error messages and validation checks
  • Added pre-flight validation - Now checks for frontend directory and package.json existence before attempting npm install
  • Consistent cross-platform behavior - Unified command execution between Windows and Unix-based systems

Technical Details

The root cause was in the run_command() helper function, which was improperly mixing shell execution parameters with list-based commands. The fix includes:

  1. Cleaner subprocess execution logic

    • Proper handling of both list and string commands
    • Removed conflicting shell parameter usage
    • Better stdout/stderr redirection for quiet mode
  2. Enhanced validation

    • Checks for frontend directory existence
    • Validates package.json presence before npm install
    • More descriptive error messages for troubleshooting
  3. Improved cross-platform compatibility

    • Consistent command formatting across OS platforms
    • Better handling of Windows-specific subprocess behavior

How to Update

Replace your existing cerno_cli.py file with the fixed version, or update your repository to the latest commit.

Additional Notes

If you previously experienced this setup issue:

  1. The fix should resolve the npm installation problems immediately
  2. You may need to clean your virtual environment and re-run setup if you have a partially installed state
  3. Ensure your frontend directory contains a valid package.json file

Full Changelog: See commit history for complete details. Shoutout to @RogerTangos for the issue report.

Feedback: If you encounter any issues with this fix, please report them in our GitHub issues.