Nodejs module working only in some folders
It's weird I have a little request (in nodejs) (
request_working.js ) that require the request module
The problem is that it works only in some folder because otherwise the module is not found!
For example my folders are this way :
node request_working.js work in the bold folders (working in the nodejs and newProject folder but not in the other newProject folder or in node_modules folder)
Because I have this error :
node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Object #
Like if I didn't have request module. (I am using a POST method from the request module) I am using Express.js ( the newProject folder = Express project ) so I want to put my request_working.js in
to use it as a module. But how wan I fix this error first ? Thanks !
Thanks david, it's working !
How to fix this error ? :
in console type :
It should gives you all the node_modules folders,
then go in the folder
newproject if it does not already existcreate a new folder
node_modules, put you modules in this folder and delete every
node_modules deeper in the directory example you should delete:
THanks again !