B
B
Bogdan Bembenok2015-11-28 01:38:45
Node.js
Bogdan Bembenok, 2015-11-28 01:38:45

How to include native modules in Node.js under Ubuntu?

I'm trying to connect my own module, it doesn't find it if it's in a folder. There are 2 cases:
require('./customModule')(app);
require('./modules/customModule')(app);
In the first - everything works and finds, in the second it finds under Windows, under Ubuntu - no, what could be the problem?
Here is the error
Error: Cannot find module './modules/customModule'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Litvinenko, 2015-11-28
@edli007

try using NODE_PATH=.
working with relative links in the requester is extremely inconvenient =)
In general, check the case, Windows ignores the case of letters, Linux does not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question