Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "npm is not installed" Despite Node.js and NPM Being Detected in Project Validation #208

Open
6 tasks done
Anass001 opened this issue Dec 7, 2024 · 6 comments
Open
6 tasks done
Labels
untriaged Newly reported issue

Comments

@Anass001
Copy link

Anass001 commented Dec 7, 2024

Describe the bug 💬

I'm trying to install web project, but I'm encountering the following error:

npm is not installed - please install Node LTS first. Visit https://nodejs.org for more information. If you did install Nodejs and this message still appears please restart your computer.
UnityEngine.Debug:LogError (object)

I have two Node.js versions installed on my system:

  • v18.20.5 (set as the default version)
  • v20.13.1

In the Project Validation window, it detects Node.js v20.13.1 and NPM 10.5.2, but I still get the error in the console.

I'm new to Unity and Needle and i just started figuring things out, so I tried some suggested solutions found in the forum.

Steps I’ve tried so far:

  • Added the second Node.js path to the additional NPM search paths in the Project Validation window (so now there are two paths).
  • Changed default node version from 20.13.1 to 18.20.5
  • Restarted Unity.
  • Restarted my computer.

Unfortunately, none of these resolved the issue.

Operating System 👩‍💻

Linux

What browsers are you seeing the problem on? 🏄‍♂️

No response

Editor Version 🎲

2022.x

Needle Exporter version

3.51.0

Project Info (Unity only) 📜

{
  "ExportInfoGameObjectName": "Export",
  "ExportInfoGameObjectIsEnabled": true,
  "UnityProjectPath": "/home/../Needle4/Assets",
  "UnityVersion": "2022.3.54f1",
  "SceneName": "Sandbox",
  "ProjectPath": "Library/Needle/Sample",
  "ProjectDirectoryExists": true,
  "ProjectIsInstalled": true,
  "NeedleEngineInstalled": true,
  "HasNodeInstalled": false,
  "NodeVersion": null,
  "NpmVersion": null,
  "TypescriptVersion": null,
  "HasTokTxInstalled": true,
  "HasMinimumToktxVersionInstalled": false,
  "RenderPipeline": "Built-in",
  "GzipEnabled": false,
  "NeedleEngineExporterVersion": "3.51.0",
  "NeedleEngineVersion": "3.51.0",
  "NeedleEngineSamplesVersion": "0.18.0",
  "NeedleEngineExporterPath": "Packages/com.needle.engine-exporter/package.json",
  "NeedleEnginePath": "/home/../Needle4/Assets/../Library/Needle/Sample/node_modules/@needle-tools/engine/package.json",
  "FileStats": null,
  "NeedleComponentsInScene": [
    "Needle.Engine.ExportInfo",
    "Needle.Engine.Codegen.ComponentGenerator",
    "Needle.Engine.Shaders.SkyboxExportSettings",
    "Needle.Engine.Deployment.DeployToFTP",
    "Needle.Engine.HtmlMeta",
    "Needle.Engine.Components.GltfObject",
    "Needle.Engine.Components.SyncedRoom",
    "Needle.Engine.Components.Networking",
    "Needle.Engine.WebXR",
    "Needle.Engine.Components.XR.XRControllerModel",
    "Needle.Engine.Components.SpectatorCamera",
    "Needle.Engine.Components.SyncedCamera",
    "Needle.Engine.Components.AvatarBlink_Simple",
    "Needle.Engine.Components.PlayerColor",
    "Needle.Engine.Components.WebARSessionRoot",
    "Needle.Engine.Components.ObjectRaycaster",
    "Needle.Engine.Components.TeleportTarget",
    "Needle.Engine.Components.XRRig",
    "Needle.Engine.Components.OrbitControls",
    "Needle.Engine.Components.XRFlag",
    "Needle.Engine.Components.Deletable",
    "Needle.Engine.Components.SyncedTransform",
    "Needle.Engine.Components.DragControls",
    "Needle.Engine.Components.DeleteBox",
    "Needle.Engine.Components.BoxGizmo",
    "Needle.Engine.Components.Duplicatable",
    "Needle.Engine.Components.NeedleMenu",
    "Needle.Engine.Readme"
  ],
  "TypeCacheIsDirty": false,
  "TypeScriptTypes": []
}

Steps to reproduce 🔢

1. Create new unity project
2. Open Sample scene
3. Try to Install Web Project
...

Reproduction ♻

No response

Discord or Discussion link

No response

Validations 🩹

@Anass001 Anass001 added the untriaged Newly reported issue label Dec 7, 2024
@hybridherbst
Copy link
Contributor

hybridherbst commented Dec 7, 2024

Thanks for the report - can you please try updating nodejs manually to latest 20 LTS?

@Anass001
Copy link
Author

Anass001 commented Dec 7, 2024

Hey, I already tried Nodejs v20.18.1 (LTS) but still facing the same problem.

@marwie
Copy link
Member

marwie commented Dec 8, 2024

Are you using nvm or something similar by any chance?

What do you get when you run npm --version in your commandline?

@Anass001
Copy link
Author

Anass001 commented Dec 8, 2024

When I initially encountered this issue, I was not using nvm. I installed nvm afterward to see if it would resolve the problem, but it made no difference.

Running npm --version outputs 10.8.2.

@marwie
Copy link
Member

marwie commented Dec 8, 2024

Can you try running the same command in Unity using the commandline helper (via menu item "Needle Engine/Internal/Command Tester")

@Anass001
Copy link
Author

Anass001 commented Dec 8, 2024

running npm --version in the command tester outputs:
/usr/bin/sh: 1: --version: not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Newly reported issue
Projects
None yet
Development

No branches or pull requests

3 participants