i have this in my code
var queries = require('./Queries.js');
when start the node server in windows cmd is ok.
I clone the proyect in a linux ec2 server , but when i start the server not works
Error: Cannot find module './Queries.js'
i have this in my code
var queries = require('./Queries.js');
when start the node server in windows cmd is ok.
I clone the proyect in a linux ec2 server , but when i start the server not works
Error: Cannot find module './Queries.js'
Queries.js
with that capitalization?
– jfriend00
Commented
Oct 27, 2016 at 2:19
Making my ment into an answer since this seems to have been your issue:
On Windows, filenames are case insensitive. On Linux, files are case sensitive. This is a mon platform difference for anyone writing cross platform code for these two platforms.
So, make sure your file is located in the proper location and is named Queries.js
with that exact capitalization.
I generally find it best to just never use mixed case (always all lowercase) in programming filenames and then you never have this issue.
Edit:
Verify the path to 'Queries.js'
Case 1) Assuming you have NodeJS installed, the correct syntax you are looking for is below
var queries = require('querystring');
Case 2) :However if you are referencing code in another javascript file put something similar to the below at the top of current file.
require('./Queries.js'); //Queries.js is in the current directory
or
require('./path/to/Queries.js'); //The path to Queries.js