Running webpack in VSTS / TFS, cannot find webpack - node.js

In my build process in VSTS I run
npm install -g webpack then npm install webpack both with working dir set to website project dir ( the dir where project.json and other main files are located as opposed to solution dir).
Then I run where webpack in command line task
or Get-Command -CommandType Application -ErrorAction SilentlyContinue -Name webpack | Select-Object -ExpandProperty Definition | echo in powershell task
and they both only return empty string.
So obviously runnig webpack -p as the as the next command only returns 'not found' type of response.
The term 'webpack' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Here are the npm listings for the global:
2016-11-04T15:11:38.0395583Z ##[section]Starting: npm install
2016-11-04T15:11:38.6826226Z [command]C:\Program Files\nodejs\npm.cmd install -g webpack
2016-11-04T15:11:48.7566299Z C:\Users\SrvBuildAgentUser\AppData\Roaming\npm\webpack -> C:\Users\SrvBuildAgentUser\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js
2016-11-04T15:11:48.8726415Z C:\Users\SrvBuildAgentUser\AppData\Roaming\npm
2016-11-04T15:11:48.8726415Z `-- webpack#1.13.3
2016-11-04T15:11:48.8726415Z
2016-11-04T15:11:48.8736416Z npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\webpack\node_modules\chokidar\node_modules\fsevents):
2016-11-04T15:11:48.8976440Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2016-11-04T15:11:48.9066449Z ##[section]Finishing: npm install
and for the one without global:
2016-11-04T15:11:48.9086451Z ##[section]Starting: npm install
2016-11-04T15:11:49.5467089Z [command]C:\Program Files\nodejs\npm.cmd install webpack
2016-11-04T15:11:56.8194361Z asp.net#1.0.0 C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite
2016-11-04T15:11:56.8204362Z +-- UNMET DEPENDENCY rxjs#5.0.0-beta.12
2016-11-04T15:11:56.8204362Z `-- webpack#1.13.3
2016-11-04T15:11:56.8204362Z
2016-11-04T15:11:56.8214363Z npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
2016-11-04T15:11:56.8214363Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.15: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2016-11-04T15:11:56.8224364Z npm WARN asp.net#1.0.0 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
2016-11-04T15:11:56.8504392Z ##[section]Finishing: npm install
and then the webpack -p will just fail with:
2016-11-04T15:11:56.8524394Z ##[section]Starting: PowerShell Script
2016-11-04T15:11:56.9024444Z ##[command]. 'C:\Users\SrvBuildAgentUser\AppData\Local\Temp\d8093b24-25d4-4c1d-aeab-5f9f41abb954.ps1'
2016-11-04T15:11:57.9345476Z C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite
2016-11-04T15:11:58.4295971Z ##[error]webpack : The term 'webpack' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At C:\Users\SrvBuildAgentUser\AppData\Local\Temp\d8093b24-25d4-4c1d-aeab-5f9f41
abb954.ps1:7 char:1
+ webpack -p
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (webpack:String) [], CommandNotF
oundException
+ FullyQualifiedErrorId : CommandNotFoundException
2016-11-04T15:11:58.4355977Z ##[error]Process completed with exit code 0 and had 1 error(s) written to the error stream.
2016-11-04T15:11:58.4375979Z ##[section]Finishing: PowerShell Script
So I even pushed node_modules/.bin/ to repo and I tried to run node_modules\.bin\webpack
and so it found the webpack but it messes up paths and won't find some modules:
2016-11-04T14:47:02.4346130Z ##[section]Starting: Run node_modules\.bin\webpack
2016-11-04T14:47:02.4366130Z ##[command]node_modules\.bin\webpack -p
2016-11-04T14:47:04.6596130Z Hash: 6a3774e770e7be6ac786
2016-11-04T14:47:04.6596130Z Version: webpack 1.13.3
2016-11-04T14:47:04.6596130Z Time: 925ms
2016-11-04T14:47:04.6596130Z Asset Size Chunks Chunk Names
2016-11-04T14:47:04.6596130Z vendor.bundle.js 734 bytes 0 [emitted] vendor
2016-11-04T14:47:04.6596130Z main.bundle.js 33.4 kB 1, 0 [emitted] main
2016-11-04T14:47:04.6596130Z [0] ./app/main.js 500 bytes {1} [built] [2 errors]
2016-11-04T14:47:04.6596130Z [1] ./app/Helpers.js 1.62 kB {1} [built]
2016-11-04T14:47:04.6596130Z [2] ./app/ProductAccessibilityValidator.js 2.06 kB {1} [built] [2 errors]
2016-11-04T14:47:04.6606130Z [3] ./app/UserProfileProvider.js 1.74 kB {1} [built] [3 errors]
2016-11-04T14:47:04.6606130Z [10] ./app/app.routing.js 1.93 kB {1} [built] [1 error]
2016-11-04T14:47:04.6606130Z [11] ./app/component.js 1.22 kB {1} [built] [1 error]
2016-11-04T14:47:04.6606130Z [20] ./app/module.js 4.09 kB {1} [built] [4 errors]
2016-11-04T14:47:04.6606130Z + 14 hidden modules
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z WARNING in main.bundle.js from UglifyJs
2016-11-04T14:47:04.6606130Z Side effects in initialization of unused variable SearchResult [./app/components/search-page.component.js:20,0]
2016-11-04T14:47:04.6606130Z Side effects in initialization of unused variable SearchResult [./app/components/product-search.component.js:20,0]
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/main.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/platform-browser-dynamic' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/main.js 2:33-77
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/main.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/core' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/main.js 3:13-37
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/module.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/core' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/module.js 11:13-37
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/module.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/platform-browser' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/module.js 12:25-61
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/module.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/forms' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/module.js 13:14-39
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/module.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/http' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/module.js 14:13-37
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/app.routing.js
2016-11-04T14:47:04.6606130Z Module not found: Error: Cannot resolve module '#angular/router' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6606130Z # ./app/app.routing.js 2:15-41
2016-11-04T14:47:04.6606130Z
2016-11-04T14:47:04.6606130Z ERROR in ./app/component.js
2016-11-04T14:47:04.6616130Z Module not found: Error: Cannot resolve module '#angular/core' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6616130Z # ./app/component.js 11:13-37
2016-11-04T14:47:04.6616130Z
2016-11-04T14:47:04.6616130Z ERROR in ./app/UserProfileProvider.js
2016-11-04T14:47:04.6616130Z Module not found: Error: Cannot resolve module '#angular/core' in C:\agent_work\10\s\mySolution.Web## Heading ##Site\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6616130Z # ./app/UserProfileProvider.js 14:13-37
2016-11-04T14:47:04.6616130Z
2016-11-04T14:47:04.6616130Z ERROR in ./app/UserProfileProvider.js
2016-11-04T14:47:04.6616130Z Module not found: Error: Cannot resolve module '#angular/http' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app
2016-11-04T14:47:04.6616130Z # ./app/UserProfileProvider.js 15:13-37
2016-11-04T14:47:04.6616130Z
2016-11-04T14:47:04.6616130Z ERROR in ./app/components/product-search.component.js
2016-11-04T14:47:04.6616130Z Module not found: Error: Cannot resolve module '#angular/core' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app\components
2016-11-04T14:47:04.6616130Z # ./app/components/product-search.component.js 14:13-37 15:13-37
2016-11-04T14:47:04.6616130Z
2016-11-04T14:47:04.6616130Z ERROR in ./app/components/product-search.component.js
2016-11-04T14:47:04.6616130Z Module not found: Error: Cannot resolve module '#angular/http' in C:\agent_work\10\s\mySolution.WebSite\src\mySolution.WebSite\wwwroot\app\components
2016-11-04T14:47:04.6616130Z # ./app/components/product-search.component.js 16:13-37
(and so on)
Can you help me fix this?

The problem is that the global directory of node is probably not in the PATH of the user running the VSTS agent.
You can probably target the webpack cmd helper using C:\NPM\Modules\webpack after installing it globally.

You can add Webpack integrated with VSTS from Marketplace to your VSTS. https://github.com/Dealogic/webpack-vsts-extension
Then exactly like Gulp you can run webpack files.

Related

Config package in Vue 3 nodejs project

I'm building a project using Vue 3 and nodejs. I need to include some configurations that should change depending on where I run the code. I found the config package that seems very promising, but I started to get a huge number of errors during the start of the project.
The first issue regards some missing packages.
Module not found: Error: Can't resolve 'util' ...
Module not found: Error: Can't resolve 'path' ...
Module not found: Error: Can't resolve 'fs' ...
Module not found: Error: Can't resolve 'os' ...
I solved them by adding this code in the config file:
resolve: {
fallback: {
fs: false,
os: false,
util: false,
path: false
}
}
Now the project starts, but I get these warnings:
warning in ./node_modules/config/lib/config.js
Critical dependency: the request of a dependency is an expression
warning in ./node_modules/config/parser.js
require.extensions is not supported by webpack. Use a loader instead.
When I surf to localhost:8080 I get:
Uncaught ReferenceError: process is not defined
Instead of using resolve.fallback, I also tried to install the dependencies:
npm install path fs os util
but I continue to get the error for fs:
Module not found: Error: Can't resolve 'fs' ...
Is there a way to use the config package easily along with Vue 3?

pyinstaller: Multiple 'lib not found' warnings when compiling .py file

I wrote a program in python, and was trying to compile it into a .exe file using pyinstaller. It gets converted successfully, and I can run the exe file on my device. However, but during compilation, I get many 'lib not found' warnings.
They are as follows:
165185 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\io\_pywrap_file_io.pyd
165210 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_op_def_util.pyd
165293 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_api_dispatcher.pyd
165329 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_device_lib.pyd
165363 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_tf_session.pyd
165389 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_debug_events_writer.pyd
165603 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\saved_model\experimental\pywrap_libexport.pyd
165627 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_errors_test_helper.pyd
165674 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\profiler\internal\_pywrap_profiler.pyd
165699 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\grappler\_pywrap_tf_item.pyd
165727 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_checkpoint_reader.pyd
165772 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_nest.pyd
165832 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_tfprof.pyd
165856 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_utils.pyd
165881 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_kernel_registry.pyd
165992 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_stat_summarizer.pyd
166012 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\io\_pywrap_record_io.pyd
166038 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\client\_pywrap_events_writer.pyd
166066 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_dtypes.pyd
166085 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\grappler\_pywrap_tf_cluster.pyd
166113 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\grappler\_pywrap_tf_optimizer.pyd
166156 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_api_info.pyd
166183 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_op_def_registry.pyd
166211 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_op_gen.pyd
166256 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\profiler\internal\_pywrap_traceme.pyd
166278 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_tensor_float_32_execution.pyd
166293 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\data\experimental\service\_pywrap_server_lib.pyd
166319 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\util\_pywrap_transform_graph.pyd
166448 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\framework\_pywrap_python_api_parameter_converter.pyd
166470 WARNING: lib not found: torch_python.dll dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\torch\_C.cp38-win_amd64.pyd
166546 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\core\_pywrap_py_func.pyd
166557 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\lib\core\_pywrap_bfloat16.pyd
166568 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow\python\platform\_pywrap_stacktrace_handler.pyd
All of them are related to tensorflow, except one which is torch_python.dll. The folder named tensorflow in site-packages exists, but the files are not there. Apart from this it shows warning for hidden imports for tensorflow again.
Following are the hidden import warnings:
130756 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.initializers" not found!
130898 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.layers.experimental.preprocessing" not found!
131048 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.layers" not found!
131050 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.v1" not found!
131057 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.backend" not found!
131057 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.datasets.reuters" not found!
131144 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.regularizers" not found!
131145 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.estimator.experimental" not found!
131146 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.premade" not found!
131147 WARNING: Hidden import "tensorflow._api.v2.compat.v2.estimator" not found!
131407 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.preprocessing.image" not found!
131456 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.datasets" not found!
131456 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.__internal__.backend" not found!
131458 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.__internal__" not found!
131458 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.losses" not found!
131464 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.applications.inception_v3" not found!
131465 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.callbacks" not found!
131468 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.datasets.cifar100" not found!
131621 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.nasnet" not found!
131622 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.activations" not found!
131631 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.estimator" not found!
131631 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.optimizers" not found!
131633 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.v2" not found!
131635 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.applications.mobilenet_v2" not found!
131644 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.datasets.reuters" not found!
131646 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.optimizers" not found!
131647 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.__internal__.legacy" not found!
131829 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.callbacks.experimental" not found!
131830 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.applications" not found!
131832 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.xception" not found!
131833 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.utils" not found!
131905 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.datasets.cifar100" not found!
131906 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.experimental" not found!
131912 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.layers.experimental.preprocessing" not found!
131962 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.inception_resnet_v2" not found!
132010 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.optimizers.schedules" not found!
132101 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.premade" not found!
132105 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.__internal__.legacy.layers.experimental" not found!
132106 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.xception" not found!
132117 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.__internal__.legacy.layers.experimental" not found!
132118 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.__internal__" not found!
132126 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.vgg19" not found!
132214 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.mixed_precision" not found!
132215 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.inception_v3" not found!
132227 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.applications.vgg19" not found!
132280 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.premade" not found!
132281 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.applications.mobilenet_v2" not found!
132291 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.preprocessing.image" not found!
132291 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.inception_resnet_v2" not found!
132292 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.applications.imagenet_utils" not found!
132295 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.datasets.imdb" not found!
132395 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.datasets" not found!
132396 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.__internal__.utils" not found!
132398 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.utils" not found!
132404 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.datasets.boston_housing" not found!
132405 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.layers.experimental.preprocessing" not found!
132406 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.premade" not found!
132408 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.estimator.tpu.experimental" not found!
132583 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.callbacks" not found!
132584 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.layers" not found!
132592 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.mixed_precision" not found!
132637 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.applications.resnet" not found!
132643 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.datasets.cifar100" not found!
132643 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.datasets.imdb" not found!
132646 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v1.keras.datasets.imdb" not found!
132647 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.estimator.tpu" not found!
132648 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.wrappers" not found!
132649 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.estimator" not found!
132650 WARNING: Hidden import "tensorflow._api.v2.compat.v2.v2" not found!
132661 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.losses" not found!
132672 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.applications.imagenet_utils" not found!
132672 WARNING: Hidden import "tensorflow._api.v2.compat.v2.compat.v2.keras.wrappers.scikit_learn" not found!
132674 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.applications.imagenet_utils" not found!
132683 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v1.keras.preprocessing.text" not found!
132684 WARNING: Hidden import "tensorflow._api.v2.compat.v2.keras.losses" not found!
132777 WARNING: Hidden import "tensorflow._api.v2.compat.v1.keras.regularizers" not found!
132778 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.vgg19" not found!
132780 WARNING: Hidden import "tensorflow._api.v2.compat.v1.compat.v2.keras.applications.resnet_v2" not found!
Is there any way I can download them and paste them into the folder or if it can auto-download in any way? Will this create an issue when running the program on another device?
Yes, Add these two arguments in your pyinstaller command:
--add-data="c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\tensorflow;."
--add-data="c:\users\chinu\appdata\local\programs\python\python38\lib\site-packages\torch\_C.cp38-win_amd64.pyd;."
I can run the exe file on my device
It means that you can run it on other devices without any issues
Is there anyway I can download them and paste them in the folder or if it can auto download in any way?
pip install tensorflow must work.
Update: Try building tensorflow manually. You can find full guides here. This will work for sure.

How to load ogr2ogr?

I installed ogr2ogr by using npm i ogr2ogr, but when I try to call ogr2ogr from TypeScript, I am getting this error. Can anyone explain how to load ogr2ogr in TypeScript?
ERROR in ./node_modules/fs-constants/browser.js
Module not found: Error: Can't resolve 'constants' in 'D:\Project\webmaps\node_modules\fs-constants'
ERROR in ./node_modules/graceful-fs/polyfills.js
Module not found: Error: Can't resolve 'constants' in 'D:\Project\webmaps\node_modules\graceful-fs'
ERROR in ./node_modules/touch/touch.js
Module not found: Error: Can't resolve 'constants' in 'D:\Project\webmaps\node_modules\touch'
ERROR in ./node_modules/archiver/lib/core.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\archiver\lib'
ERROR in ./node_modules/findit/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\findit'
ERROR in ./node_modules/fs.realpath/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\fs.realpath'
ERROR in ./node_modules/fs.realpath/old.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\fs.realpath'
ERROR in ./node_modules/glob/glob.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\glob'
ERROR in ./node_modules/glob/sync.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\glob'
ERROR in ./node_modules/graceful-fs/graceful-fs.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\graceful-fs'
ERROR in ./node_modules/mkpath/mkpath.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\mkpath'
ERROR in ./node_modules/ogr2ogr/modules/zip.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/ogr2ogr/modules/csv.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/ogr2ogr/modules/util.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/ogr2ogr/node_modules/rimraf/rimraf.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\node_modules\rimraf'
ERROR in ./node_modules/touch/touch.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\touch'
ERROR in ./node_modules/walkdir/walkdir.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\walkdir'
ERROR in ./node_modules/ogr2ogr/modules/util.js
Module not found: Error: Can't resolve 'os' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/archiver/lib/plugins/tar.js
Module not found: Error: Can't resolve 'zlib' in 'D:\Project\webmaps\node_modules\archiver\lib\plugins'
ERROR in ./node_modules/crc32-stream/lib/deflate-crc32-stream.js
Module not found: Error: Can't resolve 'zlib' in 'D:\Project\webmaps\node_modules\crc32-stream\lib'
ERROR in ./node_modules/decompress-zip/lib/extractors.js
Module not found: Error: Can't resolve 'zlib' in 'D:\Project\webmaps\node_modules\decompress-zip\lib'
Date: 2020-07-01T08:24:43.033Z - Hash: b64823683ce88d1548b1
3 unchanged chunks
chunk {main} main.js, main.js.map (main) 42.9 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 4.31 MB [initial] [rendered]
Time: 2627ms
: Compiled successfully.
Date: 2020-07-01T08:37:11.803Z - Hash: e40c5c3bb1b1fec5c8bd
3 unchanged chunks
chunk {main} main.js, main.js.map (main) 44 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5.82 MB [initial] [rendered]
Time: 12631ms
ERROR in ./node_modules/fs-constants/browser.js
Module not found: Error: Can't resolve 'constants' in 'D:\Project\webmaps\node_modules\fs-constants'
ERROR in ./node_modules/graceful-fs/polyfills.js
Module not found: Error: Can't resolve 'constants' in 'D:\Project\webmaps\node_modules\graceful-fs'
ERROR in ./node_modules/touch/touch.js
Module not found: Error: Can't resolve 'constants' in 'D:\Project\webmaps\node_modules\touch'
ERROR in ./node_modules/archiver/lib/core.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\archiver\lib'
ERROR in ./node_modules/findit/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\findit'
ERROR in ./node_modules/fs.realpath/index.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\fs.realpath'
ERROR in ./node_modules/fs.realpath/old.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\fs.realpath'
ERROR in ./node_modules/glob/glob.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\glob'
ERROR in ./node_modules/glob/sync.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\glob'
ERROR in ./node_modules/graceful-fs/graceful-fs.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\graceful-fs'
ERROR in ./node_modules/mkpath/mkpath.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\mkpath'
ERROR in ./node_modules/ogr2ogr/modules/zip.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/ogr2ogr/modules/csv.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/ogr2ogr/modules/util.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/ogr2ogr/node_modules/rimraf/rimraf.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\ogr2ogr\node_modules\rimraf'
ERROR in ./node_modules/touch/touch.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\touch'
ERROR in ./node_modules/walkdir/walkdir.js
Module not found: Error: Can't resolve 'fs' in 'D:\Project\webmaps\node_modules\walkdir'
ERROR in ./node_modules/ogr2ogr/modules/util.js
Module not found: Error: Can't resolve 'os' in 'D:\Project\webmaps\node_modules\ogr2ogr\modules'
ERROR in ./node_modules/archiver/lib/plugins/tar.js
Module not found: Error: Can't resolve 'zlib' in 'D:\Project\webmaps\node_modules\archiver\lib\plugins'
ERROR in ./node_modules/crc32-stream/lib/deflate-crc32-stream.js
Module not found: Error: Can't resolve 'zlib' in 'D:\Project\webmaps\node_modules\crc32-stream\lib'
ERROR in ./node_modules/decompress-zip/lib/extractors.js
Module not found: Error: Can't resolve 'zlib' in 'D:\Project\webmaps\node_modules\decompress-zip\lib'

Error with xlsx-style when building angular 6 app

I installed xlsx-style in my angular 6 app via yarn and I get errors when I build my app :
ERROR in ../node_modules/xlsx-style/dist/cpexcel.js
Module not found: Error: Can't resolve './cptable' in 'C:\Users\cabannesj\Documents\Virga3\virga-frontend\node_modules\xlsx-style\dist'
ERROR in ../node_modules/xlsx-style/xlsx.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\cabannesj\Documents\Virga3\virga-frontend\node_modules\xlsx-style'
ERROR in ../node_modules/xlsx-style/ods.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\cabannesj\Documents\Virga3\virga-frontend\node_modules\xlsx-style'
I added 'xlsx.core.min.js' in the script section of my angular.json file.
I don't know what is missing to get xlsx-style work with my app.

webpack -- how to include nodejs module for js/jsx in non-current directory

Trying to include a npm module in my jsx.
My dir structure is something like:
app/
node_modules/
webpack.config.json
package.json
main.js
react/
myreact1.jsx
myreact2.jsx
Note: purposely do not want a package.json & node_modules in react/
I've figured out that I have to do this for webpack2 config:
resolve: {
modules: ["node_modules", path.resolve(__dirname, "node_modules")
}
This forces webpack to first always try ./node_modules, then default to app/node_modules
However, for the module I'm trying to include in myreact.jsx (npm: "request"), this module uses alot of native node libraries like "fs" and "tls", etc.
webpack now gives me this error:
Abbreviated error:
ERROR in ./~/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/myproj/app/node_modules/request/lib'
# ./~/request/lib/har.js 3:9-22
# ./~/request/request.js
# ./~/request/index.js
# ../react/myreact1.jsx
# ./app.jsx
# ./main.js
Display-error-details version of the error:
ERROR in ./~/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/myproj/app/node_modules/request/lib'
resolve 'fs' in '/myproj/app/node_modules/request/lib'
How do I get webpack to correctly find the native node modules 'fs', 'tls', 'net' etc for 'request' module and the other 3rd party modules it uses inside it's own node_modules?
Thanks for any help

Resources