I am using nodejs 11.14.0 (and have tested with other versions too).
I have a nodejs script which uses both config.js
and require js
. The code runs on Windows 10 and most other OS versions of Windows which I need.
However, when I try to run the same code which runs on the Windows host OS in a Windows Docker Container (ie as a guest OS), I get the following error-
C:\TEMP\mypwa>node build.js
fullFilename is: C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\config\default.js
Loading[config]..C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\config\default.js
C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:928
throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3);
^
Error: Cannot parse config file: 'C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\config\default.js': TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at Config.util.parseFile (C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:928:11)
at C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:698:28
at Array.forEach (<anonymous>)
at C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:692:14
at Array.forEach (<anonymous>)
at Config.util.loadFileConfigs (C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:691:13)
at new Config (C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:122:27
)
at Object.<anonymous> (C:\TEMP\bundles\com.foo.studio.viz.core.win64\foowebstudio\node_modules\config\lib\config.js:1752:31)
at Module._compile (internal/modules/cjs/loader.js:868:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
Can you please help me fix this ?
TIA.