Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

require() same file multiple times returns multiple instances on windows. #7953

Closed
talrasha007 opened this issue Jul 16, 2014 · 3 comments
Closed
Labels

Comments

@talrasha007
Copy link

Env:

  • node.js v0.11.13 & v0.11.12
  • Windows 8.1 update 1 x64

CODE:

---- file: foo.js ----

var bar1 = require('./bar.js');

var path = require('path');
var bar2 = require(path.join(__dirname, 'bar.js'));

console.log(bar1 === bar2);

--- file: bar.js ----

console.log('bar');

Result

cmd

node foo.js

result on windows:

bar
bar
false

result on linux

bar
true

And it's ok when using node v0.10.x on windows.

@adohe-zz
Copy link

please refer #7806 maybe the same problem....

@talrasha007
Copy link
Author

:) yep, looks like the same.

@trevnorris
Copy link

Closing as duplicate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants