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

NODE_PATH is undefined ? #9372

Closed
sathishsoundharajan opened this issue Oct 30, 2016 · 6 comments
Closed

NODE_PATH is undefined ? #9372

sathishsoundharajan opened this issue Oct 30, 2016 · 6 comments
Labels
question Issues that look for answers. windows Issues and PRs related to the Windows platform.

Comments

@sathishsoundharajan
Copy link

  • Version: 4.4.2
  • Platform: Windows 10
  • Subsystem: N/A

Hi,
After installing the node.js msi i just tried node_path in node console it shows undefined. It should add the node path to env variable right ?

i didn't face any require problems as of now, which i see most of them suffer from it.

Previous Issue: nodejs/node-v0.x-archive#4356

image

@mscdex
Copy link
Contributor

mscdex commented Oct 30, 2016

The previous issue you linked to has nothing to do with process.env.NODE_PATH, it's about adding the node executable to the system's %PATH% environment variable that lets node run from any path.

process.env.NODE_PATH won't be set unless you explicitly set it before starting node.

@mscdex mscdex added question Issues that look for answers. windows Issues and PRs related to the Windows platform. labels Oct 30, 2016
@sathishsoundharajan
Copy link
Author

@mscdex Thanks. what was the previous way ?? I mean well from beginning itself is it developer todo to set the nodepath or it was working previously and broke now ??

@Fishrock123
Copy link
Contributor

You shouldn't need to set NODE_PATH in most cases.

@sathishsoundharajan
Copy link
Author

May I know the edge cases ! Purely for understanding

@gibfahn
Copy link
Member

gibfahn commented Oct 31, 2016

Basically it's a legacy thing for when you want to require local modules from a different folder (i.e. not ./node_modules. It's not really necessary now, in fact it's probably a good idea to avoid it if possible.

Docs:
https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders

@cjihrig
Copy link
Contributor

cjihrig commented Oct 31, 2016

I'm going to close, as I don't think there is anything actionable here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

5 participants