Unable to start server

I’m having issues getting the Needle Engine server running. In Unity, when I try to run the server I get this error: "Server is not responding - it could mean that another application is already running on port 3000… see the console for errors or try running “npm start”, then when I try to run “npm start” in the terminal I’m getting this error: npm ERR! could not determine executable to run.

I can’t figure out how to get this working.

Hello JGameMaker 92,

It seems like you’re facing two main issues while trying to run the Needle Engine server in Unity.

  1. Port Conflict: The error “Server is not responding - it could mean that another application is already running on port 3000” suggests that port 3000 is currently in use. You can check this by either terminating the application using that port or trying to run the server on a different port (by changing the config in your vite.config.js file, for example).

  2. npm Command Issues: The error “npm ERR! could not determine executable to run” usually occurs when the npm command cannot be executed properly, often due to misconfiguration or missing dependencies.

Steps to Resolve:

  1. Check Running Processes:

    • Ensure that no other instance is running on port 3000. You can run the following command based on your operating system:

      • For Windows:
        netstat -ano | findstr :3000
        
      • For macOS / Linux:
        lsof -i :3000
        
    • Terminate the process using the appropriate command: taskkill /PID <pid> /F (Windows) or kill -9 <pid> (macOS/Linux).

  2. Run npm install:

    • Make sure your project dependencies are installed properly. Change to your project directory in the terminal and run:
      npm install
      
  3. Run the Server:

    • After ensuring everything is set up correctly including your Node.js version (make sure it’s compatible with the Needle Engine requirements), you can attempt to run the server again:
      npm start
      
  4. Check for Node.js and npm Compatibility:

    • Ensure you have the correct version of Node.js installed. Ideally, you should match the version specified in your project or compatible with Needle Engine. If you’re unsure, consider reinstalling Node.js or updating to the latest stable version.

If you continue to experience issues, tracing back through logs or adding more debugging information can help identify specific failures.

Feel free to ask if you need further assistance or clarification!

1 replies left - Get a PRO license for more AI replies.
thread_qfXFphMetEpOJGyMRvvJG43y
Reply to this message to continue the conversation

Hi, that sounds like npm/nodejs isn’t installed. What do you get when you run npm --version or node --version in the console? Are you on windows or osx?

It says npm —version 10.1.0 and node —version v20.9.0. I’m on a Mac. I’ve tried installing and uninstalling things multiple times I’m not sure why it can’t start the server. I’ve tried all the things the AI has been saying too but it’s not working

When you start the local server a terminal window is opening (it is minimized by default) - can you check that window what it says?

Hi, it seems like there was a bug in the publish process and an invalid version got published. I’m very sorry - a new version will be available shortly

Please try clicking “Install” again on the Needle Engine component. It should then install version 3.51.4 and work again

Yeah, it won’t let me start a local server either:

“ Server is not responding - it could mean that another application is already running on port 3000 at https://localhost:3000 → see the console for errors or try running “npm start”

See my previous reply :slight_smile:

I clicked the install button. I’m on version 4.1.0-beta Node v20.9.0 and the server still won’t start. It looks like a different version than the one you’re on

Right, could you send a bugreport so we can look into the logs? Menu item Needle Engine/Report a bug

I can’t. It’s asking me to send every single file in my project. I’m not doing that

I tried switching to 3.51.4 and that didn’t fix it either

It won’t send your whole project, only the files used in the current scene. So you can reproduce the issue in another new scene (just create a new scene with a Needle Engine template project, check that it reproduces and then report a bug from that scene).

Also all uploads are encrypted and only accessible to our team for debugging. They will automatically be deleted again after a while.

Alright I sent it

Hi, so it seems you modified (?) the package template. The web project you currently have in your scene can not work because it’s incomplete and uses wrong commands.

Can you share how you setup your project?

These commands are unknown to me that you’re trying to run (they’re defined in your web porject’s package.json)

    "start": "npx @needle-tools/engine serve",
    "build": "npx @needle-tools/engine build"

It looks like you tried to use a Unity WebGL project as a basis? "name": "myunitywebgl",

The easiest way to get started is by just using one of our templates (e.g. Vite if you don’t have a specific reason to use anything else)

When I was picking a folder it kept telling me that it was an empty folder and there was no package.json file in it so the AI had me add one to it cuz it wouldn’t even let me generate a project until there was a .json file in it.

Also there was never any Vite template in there at all for me. I’m not sure how to get it either.

Either select a new empty folder
or enter a new path that doesnt exist on disc (e.g. just enter NeedleProject/newProject)

You will then see the option “Generate a new web project” as in my screenshot

If you select a folder that already has some content it’s assumed that this is the web project folder that you want to run (if it contains a package.json).

I deleted my entire Needle project folder and tried making a new one but there is still no Vite template in there anywhere. It’s supposed to come with the .unitypackage?

Did you see and click this button with Template: Vite (default) selected?