Last active
September 15, 2022 19:41
-
-
Save GiladShoham/b8d29c2ffb39bf99ee1b5ccc92b3eb90 to your computer and use it in GitHub Desktop.
require cache issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs'); | |
| try { | |
| require('my-package'); | |
| console.log('succuss require my-package'); | |
| } catch (err) { | |
| console.log('failed require my-package'); | |
| } | |
| fs.symlinkSync('pathToMyPackageInAnotherFolder', './node_modules/my-package', 'dir'); | |
| try { | |
| require('my-package'); | |
| console.log('succuss require my-package'); | |
| } catch (err) { | |
| console.log('failed require my-package'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is not related to symlinks. I updated the example to use real files.
And I have filed an issue in node.js: nodejs/node#44663