Log npm path option in Needle Engine’s Internal menu does not produce any output or response.
Hello Parul Bhatti,
It seems you’re encountering an issue with the “Log npm path” option in Needle Engine’s internal menu not producing output. This method attempts to log the npm paths by calling NpmUtils.LogPaths()
(see the documentation).
Here are a few steps to troubleshoot and resolve the issue:
-
Check Environment Path: Ensure that npm is correctly installed and accessible in your system’s PATH. You can verify this by running
npm --version
in your terminal or command prompt. -
Log Command Execution: The logging function (
LogPaths()
) utilizesProcessHelper.RunCommandEnumerable
to execute an echo command for the PATH environment variable specifically filtered for npm and nodejs paths (see the documentation). Make sure this command executes without error. -
Console Output: Check if there are any errors displayed in the Unity console regarding the command execution. Ensure that you run the Unity Editor with appropriate permissions.
-
Update Settings: If you’re using a package manager like nvm (Node Version Manager), ensure the paths are set correctly, and you might want to add additional npm search paths in the Needle Engine settings. This is especially important if the default paths do not include your npm installation.
-
Review Code: The method
NpmUtils.LogPaths()
might not return any paths if none are found in the PATH environment variable (see the documentation). If no paths related to npm are logged, the function will output “No npm paths found in PATH environment variable”.
If these steps don’t resolve the issue, could you provide more details on your operating system and the Node.js and npm versions you have installed?
Feel free to ask if you need further assistance!
1 replies left - Get a PRO license for more AI replies.
thread_yJ2UjJP7QAPPqiesUOQQhsRt
Reply to this message to continue the conversation
Hello @parul_bhatti thanks for noting. Do you have any issue with npm on your system?
Thank you for the quick response, Marcel.
Yes, the issue was caused by Unity fetching an incompatible npm link
version due to switching npm versions. Reinstalling Unity and Needle.js fixed it by resetting configurations and fetching correct versions.
Note to self: Avoid switching npm versions mid-project to prevent conflicts.