Node-red-contrib-modbus needs visual studio to install !?

Hello,
I am trying to install node-red-contrib on wnidows 10. I have a really weird error : It says that I have to install VS ??? Is this for real ? Anyone knows why ?? I'm on a student computer, if I could avoid it it would be great.


2021-05-26T10:59:16.514Z [err] gyp
2021-05-26T10:59:16.514Z [err]  ERR! find VS 
2021-05-26T10:59:16.514Z [err] gyp 
2021-05-26T10:59:16.514Z [err] ERR! find VS msvs_version not set from command line or npm config
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
2021-05-26T10:59:16.514Z [err] gyp
2021-05-26T10:59:16.514Z [err]  ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
2021-05-26T10:59:16.514Z [err] gyp ERR! 
2021-05-26T10:59:16.514Z [err] find VS looking for Visual Studio 2015
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS
2021-05-26T10:59:16.514Z [err]  - not found
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
2021-05-26T10:59:16.514Z [err] gyp
2021-05-26T10:59:16.514Z [err]  ERR! find VS 
2021-05-26T10:59:16.514Z [err] gyp ERR!
2021-05-26T10:59:16.514Z [err]  find VS **************************************************************
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS You need to install the latest version of Visual Studio
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS including the "Desktop development with C++" workload.
2021-05-26T10:59:16.514Z [err] gyp ERR!
2021-05-26T10:59:16.514Z [err]  find VS For more information consult the documentation at:
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
2021-05-26T10:59:16.514Z [err] gyp ERR! find VS **************************************************************
2021-05-26T10:59:16.514Z [err] gyp ERR!
2021-05-26T10:59:16.514Z [err]  find VS 
2021-05-26T10:59:16.515Z [err] gyp ERR! configure error
2021-05-26T10:59:16.515Z [err]  
2021-05-26T10:59:16.515Z [err] gyp ERR! stack Error: Could not find any Visual Studio installation to use
2021-05-26T10:59:16.515Z [err] gyp ERR! stack     at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
2021-05-26T10:59:16.515Z [err] gyp
2021-05-26T10:59:16.515Z [err]  ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
2021-05-26T10:59:16.515Z [err] gyp ERR! 
2021-05-26T10:59:16.515Z [err] stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
2021-05-26T10:59:16.515Z [err] gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
2021-05-26T10:59:16.515Z [err] gyp
2021-05-26T10:59:16.515Z [err]  ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
2021-05-26T10:59:16.515Z [err] gyp ERR! stack
2021-05-26T10:59:16.515Z [err]      at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
2021-05-26T10:59:16.515Z [err] gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
2021-05-26T10:59:16.515Z [err] gyp 
2021-05-26T10:59:16.515Z [err] ERR! stack     at ChildProcess.exithandler (child_process.js:326:5)
2021-05-26T10:59:16.515Z [err] gyp ERR! stack
2021-05-26T10:59:16.515Z [err]      at ChildProcess.emit (events.js:376:20)
2021-05-26T10:59:16.515Z [err] gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
2021-05-26T10:59:16.515Z [err] gyp ERR! 
2021-05-26T10:59:16.515Z [err] System Windows_NT 10.0.18363
2021-05-26T10:59:16.515Z [err] gyp ERR! command
2021-05-26T10:59:16.515Z [err]  "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2021-05-26T10:59:16.515Z [err] gyp ERR! cwd C:\Users\Student\.node-red\node_modules\@serialport\bindings
2021-05-26T10:59:16.515Z [err] gyp ERR! node -v v14.17.0
2021-05-26T10:59:16.515Z [err] gyp 
2021-05-26T10:59:16.515Z [err] ERR! node-gyp -v v5.1.0
2021-05-26T10:59:16.515Z [err] gyp ERR!
2021-05-26T10:59:16.515Z [err]  not ok 
2021-05-26T10:59:16.659Z [err] npm ERR! code ELIFECYCLE
2021-05-26T10:59:16.659Z [err] npm ERR! errno 1
2021-05-26T10:59:16.663Z [err] npm ERR! @serialport/bindings@9.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
2021-05-26T10:59:16.663Z [err] npm ERR!
2021-05-26T10:59:16.663Z [err]  Exit status 1
2021-05-26T10:59:16.663Z [err] npm ERR! 
2021-05-26T10:59:16.663Z [err] npm ERR! Failed at the @serialport/bindings@9.0.8 install script.
2021-05-26T10:59:16.663Z [err] npm
2021-05-26T10:59:16.663Z [err]  ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-05-26T10:59:16.670Z [err] 
2021-05-26T10:59:16.670Z [err] npm 
2021-05-26T10:59:16.670Z [err] ERR! A complete log of this run can be found in:
2021-05-26T10:59:16.670Z [err] npm ERR!     C:\Users\Student\AppData\Roaming\npm-cache\_logs\2021-05-26T10_59_16_665Z-debug.log

Actually, it seems to be needed to access to the serial ports ? This topic has the same issue :
https://discourse.nodered.org/t/unable-to-install-node-red-node-arduino/

If there is a way to install the contrib without VS, I'd enjoy knowing it.

There is not - however, you dont need the full VS install - just build tools as explained in that post.

From an elevated command prompt...

npm install --global windows-build-tools

... Then try installing the modbus node again.

In simple terms, the serial port binary/bindings must be built on your machine at installation time.

You can always uninstall it afterwards (but other nodes that have a compilation step will then fail)

2 Likes

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