Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve when node_modules is under a windows shared folder #129

Open
javihernandez opened this issue Jul 13, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@javihernandez
Copy link

commented Jul 13, 2017

Hi,

I'm unable to resolve certain modules when they are located under a windows shared folder. First, I'm using node-resolve 1.3.3 under windows 10 and node v6.9.1.

Here's the full trace:

02:35:56.273:  FATAL ERROR: Uncaught exception: Cannot find module 'deviceReporter' from '\\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\deviceReporter\configs' while trying to resolve require directive for deviceReporter in config at path \\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\deviceReporter\configs\gpii.deviceReporter.config.base.json while loading included configs for config at path //vboxsrv/vagrant/node_modules/universal/gpii/node_modules/deviceReporter/configs/gpii.deviceReporter.config.development.json while loading included configs for config at path //vboxsrv/vagrant/node_modules/universal/gpii/configs/gpii.config.development.all.local.json while loading included configs for config at path //vboxsrv/vagrant/node_modules/universal/tests/configs/gpii.tests.acceptance.localInstall.config.json while loading included configs for config at path \\vboxsrv\vagrant\node_modules\universal\tests\platform\windows\configs\gpii.tests.acceptance.windows.builtIn.config.json
Error: Cannot find module 'deviceReporter' from '\\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\deviceReporter\configs' while trying to resolve require directive for deviceReporter in config at path \\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\deviceReporter\configs\gpii.deviceReporter.config.base.json while loading included configs for config at path //vboxsrv/vagrant/node_modules/universal/gpii/node_modules/deviceReporter/configs/gpii.deviceReporter.config.development.json while loading included configs for config at path //vboxsrv/vagrant/node_modules/universal/gpii/configs/gpii.config.development.all.local.json while loading included configs for config at path //vboxsrv/vagrant/node_modules/universal/tests/configs/gpii.tests.acceptance.localInstall.config.json while loading included configs for config at path \\vboxsrv\vagrant\node_modules\universal\tests\platform\windows\configs\gpii.tests.acceptance.windows.builtIn.config.json
    at Function.module.exports [as sync] (\\vboxsrv\vagrant\node_modules\kettle\node_modules\resolve\lib\sync.js:40:15)
    at loadRequire (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:128:36)
    at Object.fluid.each (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Function.kettle.config.createDefaultsImpl (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:123:11)
    at loadConfigFromPath (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:81:44)
    at Object.fluid.each (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Function.kettle.config.loadSubConfigs (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:78:11)
    at Function.kettle.config.createDefaultsImpl (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:119:19)
    at loadConfigFromPath (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:81:44)
    at Object.fluid.each (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Function.kettle.config.loadSubConfigs (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:78:11)
    at Function.kettle.config.createDefaultsImpl (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:119:19)
    at loadConfigFromPath (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:81:44)
    at Object.fluid.each (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Function.kettle.config.loadSubConfigs (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:78:11)
    at Function.kettle.config.createDefaultsImpl (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:119:19)
    at loadConfigFromPath (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:81:44)
    at Object.fluid.each (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Function.kettle.config.loadSubConfigs (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:78:11)
    at Function.kettle.config.createDefaultsImpl (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:119:19)
    at Function.kettle.config.createDefaults (\\vboxsrv\vagrant\node_modules\kettle\lib\KettleConfigLoader.js:157:26)
    at Object.kettle.test.testDefToServerEnvironment (\\vboxsrv\vagrant\node_modules\kettle\lib\test\KettleTestUtils.js:250:65)
    at transformInternal (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:469:34)
    at fluid.transform (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:494:17)
    at Object.kettle.test.bootstrap (\\vboxsrv\vagrant\node_modules\kettle\lib\test\KettleTestUtils.js:276:33)
    at Object.kettle.test.bootstrapServer (\\vboxsrv\vagrant\node_modules\kettle\lib\test\KettleTestUtils.js:285:24)
    at Object.gpii.test.runTests (\\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\testing\src\Testing.js:454:24)
    at \\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\testing\src\Testing.js:490:19
    at Object.fluid.each (\\vboxsrv\vagrant\node_modules\infusion\src\framework\core\js\Fluid.js:513:17)
    at Object.gpii.test.runSuite (\\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\testing\src\Testing.js:487:11)
    at Object.gpii.test.runSuitesWithFiltering (\\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\testing\src\Testing.js:517:15)
    at Object. (\\vboxsrv\vagrant\tests\AcceptanceTests.js:31:11)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

As you can see, since the code is under a shared folder, its path begins with //vboxsrv/vagrant because it follows the UNC name convention. After debugging resolve a bit, I found out that the call to path.join here is returning in the form of /vboxsrv/vagrant (note the single / at the beginning), hence the problem. If I just don't apply the prefix (in this particular case \\) the problem goes away. I guess that in this particular case the prefix must be empty too. Or maybe I'm just wrong. What do you think?

Thanks in advance,
Javi

@ljharb

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

Could you see what value absoluteStart has here?

@javihernandez

This comment has been minimized.

Copy link
Author

commented Jul 14, 2017

Could you see what value absoluteStart has here?

sure, its value is: \\\vboxsrv\vagrant\node_modules\universal\gpii\node_modules\deviceReporter\configs

@ljharb

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

aha, interesting - it's got three slashes at the start, not two.

Any possibility your source path has three instead of two?

@javihernandez

This comment has been minimized.

Copy link
Author

commented Jul 14, 2017

Sorry, actually it has two \. When commenting on here I had to add an extra \ to see two \ in the preview tab. Looks like it actually performs well after the comment is published.

So the value is actually \\vboxsrv\vagrant\etc

@ljharb

This comment has been minimized.

Copy link
Member

commented Jul 14, 2017

(I edited your comment to use backticks instead of underscores, that's why it looks better ;-) )

@ljharb

This comment has been minimized.

Copy link
Member

commented Jun 17, 2018

This seems related to #155.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.