node.js - Specify path to node_modules in package.json -


Is there a way to move the node_module directory into an application, say to say bowerrc / bower to vendor / node_module Does it with? I thought it can be specified in package.json but I can not find any solution. Your help is greatly appreciated.

Yes, you can only set NODE_PATH env variable: According to the document: < / P>

If the NODE_PATH environment variable is set to one colon, then export export NODE_PATH = 'yourdir' / node_modules < P> The list of complete paths, then the nodes will find those paths for the module, if they can not be found anywhere else. (Note: In Windows, NODE_PATH is delimited by semicolons rather than colon.)

Additionally, the node will search in the following places:

1: $ HOME / .node_modules $ HOME / .node_libraries

3: $ PREFIX / lib / node

Where $ HOME is the user's home directory, and the $ PREFIX node is the configured node_prefix .

These are mostly for historical reasons. You are strongly encouraged to place your dependencies locally in node_module folders. They will be loaded faster, and will be loaded more confidently.



Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -