javascript-obfuscator / javascript-obfuscator-ui

A web UI to the JavaScript Obfuscator node.js package.
https://obfuscator.io
BSD 2-Clause "Simplified" License
230 stars 130 forks source link

fails on build startup in codesanbox.io #90

Open danindiana opened 11 months ago

danindiana commented 11 months ago

error javascript-obfuscator@4.0.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "12.13.1" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

The error message you're encountering indicates a compatibility issue between the javascript-obfuscator module you're trying to use and your current Node.js version. The module requires a Node.js version of either "^12.22.0", "^14.17.0", or ">=16.0.0", but you have "12.13.1" installed.

Here's how you can resolve this:

Upgrade Node.js You need to upgrade your Node.js to a compatible version. The easiest way to manage Node.js versions is by using nvm (Node Version Manager).

Install nvm (if you haven't already):

bash Copy code curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

or

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash After installing, you may need to restart your terminal or source your profile (source ~/.bashrc or source ~/.zshrc, depending on your shell).

Install a compatible Node.js version:

bash Copy code nvm install 14.17.0 # for version 14.17.0

or

nvm install 16 # for the latest in the 16.x line Choose the version that best suits your project requirements.

Switch to the installed Node.js version:

bash Copy code nvm use 14.17.0

or

nvm use 16 Verify the Node.js version:

bash Copy code node --version Reinstall Dependencies After upgrading Node.js, navigate to your project directory and reinstall your dependencies:

bash Copy code yarn install This should resolve the compatibility issue, and yarn install should complete without the error you were encountering. If your project has specific version requirements, make sure the Node.js version you choose aligns with those requirements.