You can use this to delete its entry in the cache:
delete require.cache[require.resolve('./b.js')]
require.resolve()
will figure out the full path of ./b.js
, which is used as a cache key.
More Related Contents:
- How to deal with cyclic dependencies in Node.js
- Nodejs cannot find installed module on Windows
- The difference between “require(x)” and “import x”
- module.exports vs. export default in Node.js and ES6
- How to make node.js require absolute? (instead of relative)
- Declare multiple module.exports in Node.js
- Using the Underscore module with Node.js
- What is the difference between require(‘mypackage.js’) and require(‘mypackage’)?
- Detect if called through require or directly by command line
- How can I import an ES module in the Node.js REPL in Node 8?
- How does require work with new operator in node.js?
- How can I make Node.js ‘require’ absolute? (instead of relative)
- FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed – process out of memory
- How do I get the path to the current script with Node.js?
- Reading value from console, interactively
- How to store Node.js deployment settings/configuration files?
- How can I uninstall npm modules in Node.js?
- nodejs – http.createServer seems to call twice
- Remove route mappings in NodeJS Express
- Can’t run my Node.js Typescript project TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.ts” for /app/src/App.ts
- bundling precompiled binary into electron app
- Google spreadsheet api Request had insufficient authentication scopes
- mongoose field with the name type
- Express res.sendfile throwing forbidden error
- ExpressJS & Websocket & session sharing
- Node.js setting up environment specific configs to be used with everyauth
- Node.js spawn child process and get terminal output live
- Error message “ENOENT, no such file or directory”
- How can I get Express.js to 404 only on missing routes?
- Firebase realtime database transaction handler gets called twice most of the time