Node-gyp version Error

Hi,
I am a student on a technician college and today our prof told us to use node-red with our groove project to interact with it over the serial port.
People like me with own devices were totally lost, because he did not provide any help in getting node-red running on our machines, beside to tell us the link of the node-red website.

So far I got node.js, npm and node-red installed and up running too.
But now I can't install the Serial Port pallet and get always a node-red and node-gyp version error, while I am using the latest node-gyp 7.1.2 and red 12.19. :face_with_monocle:

If someone could help me to solve this problem and getting the Serial Port installed, I would be extremely thankful. :hugs:

ps. I did 1:1 the steps on my PC and everything worked like a charm. Finished the school work and handed it in. But still, wiped node-red and node.js from my laptop, rebooted, repeated the same tasks as on my PC and like provided on the site here, result is the same as in the pic above. :pensive:

Did you follow these instructions for installing on Windows? https://nodered.org/docs/getting-started/windows.

Open a terminal and go your .node-red folder, then run
npm install node-red-node-serialport
and copy/paste the result here (not a screenshot please). When pasting in logs (or code or flows) use the </> button at the top of the forum text entry window to ensure the forum doesn't mess with the text.
That may just show the same error, but it may provide more information. Please post it anyway, along with the line where you enter the command.

1 Like

Yes, I followed the steps from https://nodered.org/docs/getting-started/windows..

Did run the line from the .node-red folder and got this:

C:\Users\Haral>cd .node-red

C:\Users\Haral\.node-red>npm install node-red-node-serialport

> @serialport/bindings@9.0.2 install C:\Users\Haral\.node-red\node_modules\@serialport\bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.19.0 runtime=node arch=x64 libc= platform=win32)

C:\Users\Haral\.node-red\node_modules\@serialport\bindings>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
The projects in this solution are created one after the other. To enable parallel creation, you must add the "-m" switch.
  serialport.cpp
  serialport_win.cpp
  win_delay_load_hook.cc
C:\\Users\\Haral\\AppData\\Local\\node-gyp\\Cache\\12.19.0\\x64\\node.lib : fatal error LNK1106: Invalid file or disk full: Cannot position on 0x2FF6B4. [C:\Users\Haral\.node-red\node_modules\@serialport\bindings\
build\bindings.vcxproj]
e[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mbuild errore[0m
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mstacke[0m Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mstacke[0m     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mstacke[0m     at ChildProcess.emit (events.js:314:20)
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mstacke[0m     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mSysteme[0m Windows_NT 10.0.18363
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mcommande[0m "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mcwde[0m C:\Users\Haral\.node-red\node_modules\@serialport\bindings
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mnode -ve[0m v12.19.0
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mnode-gyp -ve[0m v5.1.0
e[0me[37;40mgype[0m e[0me[31;40mERR!e[0m e[0me[35mnot oke[0m
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@9.0.2 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@9.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Haral\AppData\Roaming\npm-cache\_logs\2020-10-21T16_50_03_442Z-debug.log

C:\Users\Haral\.node-red>

Either your disc is full or that file is corrupted. Assuming the disc is not full then rename the cache folder to move it out of the way and try again.

[Edit] Actually as I look at it again and do some googling I am not sure that is correct. I think it may something more significant. I think I will have to leave this for someone with more knowledge of node-gyp and Windows. @dceejay?

1 Like

Have you installed build tools?

npm install --global --production windows-build-tools

Do that then try installing serial port again once it's done.

Note. This can take some time.
Note. Once installed, open a new CMD window (so that new env vars are loaded) for installing serial port.

1 Like

Windows-build-tools are installed.
Same result.

ps. And no, my disk is not full. Around 70 GB free space.

Must be some environment config problem. Eg see https://stackoverflow.com/questions/49161334/node-addon-compilation-error and others

Maybe flush npm cache

1 Like

Awesome!
It works now. :smiling_face_with_three_hearts:
I've deleted:

../User/Name/node_modules/serialport
../User/Name/.node-red/node_modules/@Serialport
../User/Name/AppData/Local/node_gyp/Cache

Node-red told me about a fail install, I then started the browser and installed serial port via the palette and it worked. :grinning: :+1:
Thank you all for the support.

1 Like

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