0
I have this module in a file called timer.js
module.exports = {
iniciar(){
console.log('oi');
}
}
I am trying to import this module into the index.js file as follows:
const timer = require('./timer');
only that you are returning to me this mistake:
Uncaught Error: Cannot find module './timer'
Can someone help me?
send a
tree
of its main directory– David Schrammel
Sorry, I don’t know what a Tree rs.
– Francis Vagner da Luz
Its file structure, https://www.geeksforgeeks.org/tree-command-unixlinux/
– David Schrammel
I posted the image in the question
– Francis Vagner da Luz
Your code is in the main.js file?
– David Schrammel
No, the file I want to export is in timer.js and I want to import it in index.js
– Francis Vagner da Luz