Problems instaling node-red-contrib-talib on windows

Hi,

I have problem installing node-red-contrib-talib on my windows machine.

6 Mar 14:16:54 - [info] Node-RED version: v2.2.2
6 Mar 14:16:54 - [info] Node.js  version: v16.14.0
6 Mar 14:16:54 - [info] Windows_NT 10.0.19043 x64 LE
6 Mar 14:16:55 - [info] Loading palette nodes
6 Mar 14:16:58 - [info] Dashboard version 3.1.6 started at /ui
6 Mar 14:16:58 - [info] Settings file  : C:\Users\chill\.node-red\settings.js
6 Mar 14:16:58 - [info] Context store  : 'default' [module=memory]
6 Mar 14:16:58 - [info] User directory : \Users\chill\.node-red
6 Mar 14:16:58 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Mar 14:16:58 - [info] Flows file     : \Users\chill\.node-red\flows.json

Whether I try to install it through palette or powershell (core) the error is the same
This is log from palette

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install',
0 verbose cli   '--no-audit',
0 verbose cli   '--no-update-notifier',
0 verbose cli   '--no-fund',
0 verbose cli   '--save',
0 verbose cli   '--save-prefix=~',
0 verbose cli   '--production',
0 verbose cli   '--engine-strict',
0 verbose cli   'node-red-contrib-talib@0.0.8'
0 verbose cli ]
1 info using npm@8.3.1
2 info using node@v16.14.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 1ms
6 timing config:load:builtin Completed in 2ms
7 verbose config production Use `--omit=dev` instead.
8 timing config:load:cli Completed in 2ms
9 timing config:load:env Completed in 1ms
10 timing config:load:file:C:\Users\chill\.node-red\.npmrc Completed in 1ms
11 timing config:load:project Completed in 3ms
12 timing config:load:file:C:\Users\chill\.npmrc Completed in 0ms
13 timing config:load:user Completed in 0ms
14 timing config:load:file:C:\Users\chill\AppData\Roaming\npm\etc\npmrc Completed in 1ms
15 timing config:load:global Completed in 1ms
16 timing config:load:validate Completed in 0ms
17 timing config:load:credentials Completed in 0ms
18 timing config:load:setEnvs Completed in 1ms
19 timing config:load Completed in 12ms
20 timing npm:load:configload Completed in 12ms
21 timing npm:load:setTitle Completed in 1ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:display Completed in 2ms
24 verbose logfile C:\Users\chill\AppData\Local\npm-cache\_logs\2022-03-06T15_21_27_749Z-debug-0.log
25 timing npm:load:logFile Completed in 6ms
26 timing npm:load:timers Completed in 0ms
27 timing npm:load:configScope Completed in 0ms
28 timing npm:load Completed in 21ms
29 timing arborist:ctor Completed in 0ms
30 silly logfile start cleaning logs, removing 2 files
31 timing idealTree:init Completed in 73ms
32 timing idealTree:userRequests Completed in 2ms
33 silly idealTree buildDeps
34 silly fetch manifest node-red-contrib-talib@0.0.8
35 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
36 http fetch GET 200 https://registry.npmjs.org/node-red-contrib-talib 958ms (cache revalidated)
37 silly placeDep ROOT node-red-contrib-talib@0.0.8 OK for: node-red-project@0.0.1 want: 0.0.8
38 silly fetch manifest talib@^1.0.4
39 http fetch GET 200 https://registry.npmjs.org/talib 812ms (cache revalidated)
40 timing idealTree:#root Completed in 1774ms
41 silly placeDep ROOT talib@1.1.4 OK for: node-red-contrib-talib@0.0.8 want: ^1.0.4
42 silly fetch manifest nan@^2.13.2
43 http fetch GET 200 https://registry.npmjs.org/nan 40ms (cache revalidated)
44 timing idealTree:node_modules/node-red-contrib-talib Completed in 42ms
45 silly placeDep ROOT nan@2.15.0 OK for: talib@1.1.4 want: ^2.13.2
46 timing idealTree:node_modules/talib Completed in 1ms
47 timing idealTree:node_modules/nan Completed in 0ms
48 timing idealTree:buildDeps Completed in 1818ms
49 timing idealTree:fixDepFlags Completed in 1ms
50 timing idealTree Completed in 1896ms
51 timing reify:loadTrees Completed in 1896ms
52 timing reify:diffTrees Completed in 4ms
53 silly reify moves {}
54 timing reify:retireShallow Completed in 1ms
55 timing reify:createSparse Completed in 1ms
56 timing reify:trashOmits Completed in 0ms
57 timing reify:loadBundles Completed in 0ms
58 timing reifyNode:node_modules/node-red-contrib-talib Completed in 110ms
59 timing reifyNode:node_modules/nan Completed in 129ms
60 timing reifyNode:node_modules/talib Completed in 643ms
61 timing reify:unpack Completed in 643ms
62 timing reify:unretire Completed in 0ms
63 timing build:queue Completed in 0ms
64 info run talib@1.1.4 install node_modules/talib node ./src/lib/build.js && node-gyp configure && node-gyp build
65 info run talib@1.1.4 install { code: 1, signal: null }
66 timing reify:rollback:createSparse Completed in 42ms
67 timing reify:rollback:retireShallow Completed in 0ms
68 timing command:install Completed in 2785ms
69 verbose stack Error: command failed
69 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
69 verbose stack     at ChildProcess.emit (node:events:520:28)
69 verbose stack     at maybeClose (node:internal/child_process:1092:16)
69 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
70 verbose pkgid talib@1.1.4
71 verbose cwd C:\Users\chill\.node-red
72 verbose Windows_NT 10.0.19043
73 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "--engine-strict" "node-red-contrib-talib@0.0.8"
74 verbose node v16.14.0
75 verbose npm  v8.3.1
76 error code 1
77 error path C:\Users\chill\.node-red\node_modules\talib
78 error command failed
79 error command powershell -c node ./src/lib/build.js && node-gyp configure && node-gyp build
80 error At line:1 char:25
80 error + node ./src/lib/build.js && node-gyp configure && node-gyp build
80 error +                         ~~
80 error The token '&&' is not a valid statement separator in this version.
80 error At line:1 char:47
80 error + node ./src/lib/build.js && node-gyp configure && node-gyp build
80 error +                                               ~~
80 error The token '&&' is not a valid statement separator in this version.
80 error     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
80 error     + FullyQualifiedErrorId : InvalidEndOfLine
81 verbose exit 1
82 timing npm Completed in 3078ms
83 verbose unfinished npm timer reify 1646580088041
84 verbose unfinished npm timer reify:build 1646580090589
85 verbose unfinished npm timer build 1646580090590
86 verbose unfinished npm timer build:deps 1646580090590
87 verbose unfinished npm timer build:run:install 1646580090590
88 verbose unfinished npm timer build:run:install:node_modules/talib 1646580090591
89 verbose code 1

Apparently powershell does not support && so I installed powershell core 7.2.1 and trying
npm i node-red-contrib-talib
I get the same error

PS C:\Users\chill> cd C:\Users\chill\.node-red
PS C:\Users\chill\.node-red> npm i node-red-contrib-talib
npm ERR! code 1
npm ERR! path C:\Users\chill\.node-red\node_modules\talib
npm ERR! command failed
npm ERR! command powershell -c node ./src/lib/build.js && node-gyp configure && node-gyp build
npm ERR! At line:1 char:25
npm ERR! + node ./src/lib/build.js && node-gyp configure && node-gyp build
npm ERR! +                         ~~
npm ERR! The token '&&' is not a valid statement separator in this version.
npm ERR! At line:1 char:47
npm ERR! + node ./src/lib/build.js && node-gyp configure && node-gyp build
npm ERR! +                                               ~~
npm ERR! The token '&&' is not a valid statement separator in this version.
npm ERR!     + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
npm ERR!     + FullyQualifiedErrorId : InvalidEndOfLine

I can see that install script calls for powershell but not the core one (pwsh.exe)

Where can I edit this install script or better yet is there another way of installing the modules manually?

Any help is appreciated.
Tnx.

Upgrade to Powershell 7+ then && will be supported.

I did install Powershell 7 but the install script calls for powershell.exe not the pwsh.exe (ver 7.x.x executable).

Is there a way to install node-talib and node-red-contrib-talib manually?
I have both archives node-talib-master.zip and node-red-contrib-talib-master.zip available on my desktop.

OK, I made some progress with this
npm config set script-shell "C:\Program Files\PowerShellCore\7\pwsh.exe"

and now I am at the next barrier (see error log below). Someone help me please, I am not sure I can interpret this log fully

0 verbose cli [
0 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli   'install',
0 verbose cli   '--no-audit',
0 verbose cli   '--no-update-notifier',
0 verbose cli   '--no-fund',
0 verbose cli   '--save',
0 verbose cli   '--save-prefix=~',
0 verbose cli   '--production',
0 verbose cli   '--engine-strict',
0 verbose cli   'node-red-contrib-talib@0.0.8'
0 verbose cli ]
1 info using npm@8.3.1
2 info using node@v16.14.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 3ms
7 verbose config production Use `--omit=dev` instead.
8 timing config:load:cli Completed in 1ms
9 timing config:load:env Completed in 0ms
10 timing config:load:file:C:\Users\chill\.node-red\.npmrc Completed in 0ms
11 timing config:load:project Completed in 2ms
12 timing config:load:file:C:\Users\chill\.npmrc Completed in 1ms
13 timing config:load:user Completed in 1ms
14 timing config:load:file:C:\Users\chill\AppData\Roaming\npm\etc\npmrc Completed in 0ms
15 timing config:load:global Completed in 0ms
16 timing config:load:validate Completed in 0ms
17 timing config:load:credentials Completed in 1ms
18 timing config:load:setEnvs Completed in 1ms
19 timing config:load Completed in 11ms
20 timing npm:load:configload Completed in 11ms
21 timing npm:load:setTitle Completed in 0ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:display Completed in 3ms
24 verbose logfile C:\Users\chill\AppData\Local\npm-cache\_logs\2022-03-07T13_08_05_197Z-debug-0.log
25 timing npm:load:logFile Completed in 11ms
26 timing npm:load:timers Completed in 0ms
27 timing npm:load:configScope Completed in 0ms
28 timing npm:load Completed in 26ms
29 timing arborist:ctor Completed in 0ms
30 silly logfile start cleaning logs, removing 2 files
31 timing idealTree:init Completed in 70ms
32 timing idealTree:userRequests Completed in 2ms
33 silly idealTree buildDeps
34 silly fetch manifest node-red-contrib-talib@0.0.8
35 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
36 http fetch GET 200 https://registry.npmjs.org/node-red-contrib-talib 61ms (cache hit)
37 silly placeDep ROOT node-red-contrib-talib@0.0.8 OK for: node-red-project@0.0.1 want: 0.0.8
38 silly fetch manifest talib@^1.0.4
39 http fetch GET 200 https://registry.npmjs.org/talib 9ms (cache hit)
40 timing idealTree:#root Completed in 76ms
41 silly placeDep ROOT talib@1.1.4 OK for: node-red-contrib-talib@0.0.8 want: ^1.0.4
42 silly fetch manifest nan@^2.13.2
43 http fetch GET 200 https://registry.npmjs.org/nan 4ms (cache hit)
44 timing idealTree:node_modules/node-red-contrib-talib Completed in 7ms
45 silly placeDep ROOT nan@2.15.0 OK for: talib@1.1.4 want: ^2.13.2
46 timing idealTree:node_modules/talib Completed in 1ms
47 timing idealTree:node_modules/nan Completed in 0ms
48 timing idealTree:buildDeps Completed in 84ms
49 timing idealTree:fixDepFlags Completed in 1ms
50 timing idealTree Completed in 159ms
51 timing reify:loadTrees Completed in 159ms
52 timing reify:diffTrees Completed in 3ms
53 silly reify moves {}
54 timing reify:retireShallow Completed in 0ms
55 timing reify:createSparse Completed in 1ms
56 timing reify:trashOmits Completed in 0ms
57 timing reify:loadBundles Completed in 0ms
58 timing reifyNode:node_modules/node-red-contrib-talib Completed in 121ms
59 timing reifyNode:node_modules/nan Completed in 134ms
60 timing reifyNode:node_modules/talib Completed in 508ms
61 timing reify:unpack Completed in 508ms
62 timing reify:unretire Completed in 0ms
63 timing build:queue Completed in 1ms
64 info run talib@1.1.4 install node_modules/talib node ./src/lib/build.js && node-gyp configure && node-gyp build
65 info run talib@1.1.4 install { code: 1, signal: null }
66 timing reify:rollback:createSparse Completed in 40ms
67 timing reify:rollback:retireShallow Completed in 0ms
68 timing command:install Completed in 4356ms
69 verbose stack Error: command failed
69 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
69 verbose stack     at ChildProcess.emit (node:events:520:28)
69 verbose stack     at maybeClose (node:internal/child_process:1092:16)
69 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
70 verbose pkgid talib@1.1.4
71 verbose cwd C:\Users\chill\.node-red
72 verbose Windows_NT 10.0.19043
73 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "--engine-strict" "node-red-contrib-talib@0.0.8"
74 verbose node v16.14.0
75 verbose npm  v8.3.1
76 error code 1
77 error path C:\Users\chill\.node-red\node_modules\talib
78 error command failed
79 error command C:\Program Files\PowerShellCore\7\pwsh.exe -c node ./src/lib/build.js && node-gyp configure && node-gyp build
80 error building talib functions...
80 error  The system cannot find the path specified.
80 error
80 error Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
80 error   talib.cpp
80 error C:\Users\chill\.node-red\node_modules\talib\src\talib.cpp(85,13): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\chill\.node-red\node_modules\talib\build\talib.vcxproj]
80 error C:\Users\chill\.node-red\node_modules\talib\src\talib.cpp(95,13): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\chill\.node-red\node_modules\talib\build\talib.vcxproj]
80 error C:\Users\chill\.node-red\node_modules\talib\src\talib.cpp(546,13): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\chill\.node-red\node_modules\talib\build\talib.vcxproj]
80 error   win_delay_load_hook.cc
80 error LINK : fatal error LNK1181: cannot open input file '..\src\lib\lib\ta_libc_csr.lib' [C:\Users\chill\.node-red\node_modules\talib\build\talib.vcxproj]
81 error gyp info it worked if it ends with ok
81 error gyp info using node-gyp@8.4.1
81 error gyp info using node@16.14.0 | win32 | x64
81 error gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
81 error gyp info find VS using VS2019 (16.11.32126.315) found at:
81 error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
81 error gyp info find VS run with --verbose for detailed information
81 error gyp info spawn C:\Python310\python.exe
81 error gyp info spawn args [
81 error gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
81 error gyp info spawn args   'binding.gyp',
81 error gyp info spawn args   '-f',
81 error gyp info spawn args   'msvs',
81 error gyp info spawn args   '-I',
81 error gyp info spawn args   'C:\\Users\\chill\\.node-red\\node_modules\\talib\\build\\config.gypi',
81 error gyp info spawn args   '-I',
81 error gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
81 error gyp info spawn args   '-I',
81 error gyp info spawn args   'C:\\Users\\chill\\AppData\\Local\\node-gyp\\Cache\\16.14.0\\include\\node\\common.gypi',
81 error gyp info spawn args   '-Dlibrary=shared_library',
81 error gyp info spawn args   '-Dvisibility=default',
81 error gyp info spawn args   '-Dnode_root_dir=C:\\Users\\chill\\AppData\\Local\\node-gyp\\Cache\\16.14.0',
81 error gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
81 error gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\chill\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.14.0\\\\<(target_arch)\\\\node.lib',
81 error gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\chill\\.node-red\\node_modules\\talib',
81 error gyp info spawn args   '-Dnode_engine=v8',
81 error gyp info spawn args   '--depth=.',
81 error gyp info spawn args   '--no-parallel',
81 error gyp info spawn args   '--generator-output',
81 error gyp info spawn args   'C:\\Users\\chill\\.node-red\\node_modules\\talib\\build',
81 error gyp info spawn args   '-Goutput_dir=.'
81 error gyp info spawn args ]
81 error gyp info ok 
81 error gyp info it worked if it ends with ok
81 error gyp info using node-gyp@8.4.1
81 error gyp info using node@16.14.0 | win32 | x64
81 error gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
81 error gyp info spawn args [
81 error gyp info spawn args   'build/binding.sln',
81 error gyp info spawn args   '/clp:Verbosity=minimal',
81 error gyp info spawn args   '/nologo',
81 error gyp info spawn args   '/p:Configuration=Release;Platform=x64'
81 error gyp info spawn args ]
81 error gyp ERR! build error 
81 error gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
81 error gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
81 error gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
81 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
81 error gyp ERR! System Windows_NT 10.0.19043
81 error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build"
81 error gyp ERR! cwd C:\Users\chill\.node-red\node_modules\talib
81 error gyp ERR! node -v v16.14.0
81 error gyp ERR! node-gyp -v v8.4.1
81 error gyp ERR! not ok
82 verbose exit 1
83 timing npm Completed in 4659ms
84 verbose unfinished npm timer reify 1646658485496
85 verbose unfinished npm timer reify:build 1646658486174
86 verbose unfinished npm timer build 1646658486174
87 verbose unfinished npm timer build:deps 1646658486174
88 verbose unfinished npm timer build:run:install 1646658486175
89 verbose unfinished npm timer build:run:install:node_modules/talib 1646658486175
90 verbose code 1

OK, installed. Here is a quick recap...

  1. make sure you have VS2015, others don't seem to work
  2. install PowerShellCore, preferably ver 7+
  3. npm config set script-shell "C:\Program Files\PowerShellCore\7\pwsh.exe"
  4. npm install --global windows-build-tools --vs2015
  5. npm config set msvs_version 2015
  6. install node-red-contrib-talib via palette

GL!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.