Hi to all,
Sorry if this topic is already solved, i was looking for the solution but couldnt find one.
I am trying to install node " node-red-contrib-serial-modbus" but unsuccessfully.
Below is the error i get.
Any help is much appreciated.
C:\Users\vkrtolica>npm install node-red-contrib-serial-modbus
npm warn deprecated npmlog@4.1.2: This package is no longer supported.
npm warn deprecated are-we-there-yet@1.1.7: This package is no longer supported.
npm warn deprecated gauge@2.7.4: This package is no longer supported.
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup '\\\\?\\C:\\Users\\vkrtolica\\node_modules\\@serialport\\bindings',
npm warn cleanup [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\vkrtolica\node_modules\@serialport\bindings'] {
npm warn cleanup errno: -4082,
npm warn cleanup code: 'EBUSY',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\vkrtolica\\node_modules\\@serialport\\bindings'
npm warn cleanup }
npm warn cleanup ],
npm warn cleanup [
npm warn cleanup '\\\\?\\C:\\Users\\vkrtolica\\node_modules\\prebuild-install',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\vkrtolica\node_modules\prebuild-install\node_modules\readable-stream\lib\internal'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\vkrtolica\\node_modules\\prebuild-install\\node_modules\\readable-stream\\lib\\internal'
npm warn cleanup }
npm warn cleanup ],
npm warn cleanup [
npm warn cleanup '\\\\?\\C:\\Users\\vkrtolica\\node_modules\\node-red-contrib-serial-modbus\\node_modules',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\vkrtolica\node_modules\node-red-contrib-serial-modbus\node_modules'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\vkrtolica\\node_modules\\node-red-contrib-serial-modbus\\node_modules'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\vkrtolica\node_modules\node-red-contrib-serial-modbus\node_modules\modbus-serial\node_modules\@serialport\bindings
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@9.4.1
npm error gyp info using node@22.12.0 | win32 | x64
npm error (node:9336) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info find Python using Python version 3.13.1 found at "C:\Python313\python.exe"
npm error gyp info find VS using VS2022 (17.13.35828.75) found at:
npm error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
npm error gyp info find VS run with --verbose for detailed information
npm error gyp info spawn C:\Python313\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\\Users\\vkrtolica\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'msvs',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\vkrtolica\\node_modules\\node-red-contrib-serial-modbus\\node_modules\\modbus-serial\\node_modules\\@serialport\\bindings\\build\\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\vkrtolica\\node_modules\\node-gyp\\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\\Users\\vkrtolica\\AppData\\Local\\node-gyp\\Cache\\22.12.0\\include\\node\\common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=C:\\Users\\vkrtolica\\AppData\\Local\\node-gyp\\Cache\\22.12.0',
npm error gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\vkrtolica\\node_modules\\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\vkrtolica\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\22.12.0\\\\<(target_arch)\\\\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=C:\\Users\\vkrtolica\\node_modules\\node-red-contrib-serial-modbus\\node_modules\\modbus-serial\\node_modules\\@serialport\\bindings',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'C:\\Users\\vkrtolica\\node_modules\\node-red-contrib-serial-modbus\\node_modules\\modbus-serial\\node_modules\\@serialport\\bindings\\build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Traceback (most recent call last):
npm error File "C:\Users\vkrtolica\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
npm error import gyp # noqa: E402
npm error ^^^^^^^^^^
npm error File "C:\Users\vkrtolica\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 9, in <module>
npm error import gyp.input
npm error File "C:\Users\vkrtolica\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
npm error from distutils.version import StrictVersion
npm error ModuleNotFoundError: No module named 'distutils'
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.onCpExit (C:\Users\vkrtolica\node_modules\node-gyp\lib\configure.js:325:16)
npm error gyp ERR! stack at ChildProcess.emit (node:events:524:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm error gyp ERR! System Windows_NT 10.0.26100
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\vkrtolica\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm error gyp ERR! cwd C:\Users\vkrtolica\node_modules\node-red-contrib-serial-modbus\node_modules\modbus-serial\node_modules\@serialport\bindings
npm error gyp ERR! node -v v22.12.0
npm error gyp ERR! node-gyp -v v9.4.1
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\vkrtolica\AppData\Local\npm-cache\_logs\2025-03-19T09_19_59_449Z-debug-0.log