Node.JS Configuration

Hi, I’m getting this error “Detected script change but Node.js is not installed or could not be found. Please install Node.js to enable automatic C# code generation.” Went through the docs and couldn’t find how to configure it (if configuring is even needed). I have V20.9 on my Windows system I’ve been having to remove/readd components/scripts to get them to update. How can I make it so scripts auto generate and update in my project?

Original Post on Discord

by user 507643794963824650

Hello there – we have an experimental AI bot :robot: that might be able to help you with your question. Would you like to try this out?

How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.

Help requested: please wait a moment…

Here is what I found for you :brain: Discord

Hello 0nederful,

The error you’re encountering indicates that the Needle Engine’s TypeScript to C# Component Compiler is unable to locate Node.js on your system, which is necessary for automatic C# code generation. To resolve this issue, follow these steps:

  1. If you haven’t already, download and install Node.js from the official website:

  2. Ensure that Node.js is correctly installed by opening a command prompt or terminal and typing node -v. This should print out the version of Node.js you have installed.

  3. Make sure Node.js is added to your system’s PATH environment variable. You might need to restart your computer or your IDE after installing Node.js for the changes to take effect.

  4. In Unity, go to Edit > Preferences on Windows or Unity > Preferences on macOS, then select the External Tools tab and verify that the Node.js path is set correctly.

  5. If the issue persists, manually verify that the TypeScript to C# Component Compiler is pointing to the correct Node.js executable by checking the configuration in the ‘ExportInfo’ component within Unity.

By ensuring that Node.js is properly installed and configured, the automatic C# code generation should start working correctly, and your scripts should update in the project automatically.

If you still have issues, please refer to the Needle Engine Technical Overview or the FAQ in the documentation for more assistance or consider contacting the Needle Engine support team for further help.

1 messages left GPT 4

Hi, what do you mean you had to remove and add components to update? Can you make a video of that? Which unity version are you using?

You dont need to configure anything else usually. If you see this message restarting Unity might fix it if nodejs is installed and was found before or you can try to re-save your script (add a space for example and save) and then focus unity again