Error: Cannot find module './Categories' linux?



  • On my mac I have everything working smoothly when I deployed it on my linux server everything runs fine except for the call to the Categories module.

    Here is how I call the module inside my /theme.js file inside the root of my theme.

    console.log(module.parent)
    var Categories = module.parent.require("./Categories");
    

    I took a look at the result of module.parent and I am not seeing categories available, but I do see it available locally.

    I tried hard linking to the module ../../src/Categories but no luck.

    Does anyone have a clue why this is happening?



  • I can require other modules that are exposed inside the module.parent but I am so confused why Categories is not exposed?


  • Admin

    Maybe try lowercase? require('./categories');



  • @baris Holy shit it actually worked but I dont see it in the console.log?


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.