Hi, I was working on downgrading the node.js version and after all that i came across this error.
C:\Users\weeseong.hew>npm install node-red-contrib-modbus
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Program Filed\git\bin\bash.exe
npm ERR! path C:\Users\weeseong.hew\node_modules\@serialport\bindings
npm ERR! errno ENOENT
npm ERR! enoent spawn C:\Program Filed\git\bin\bash.exe ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
I recall the last thing I did was setting "npm config set script-shell "C:\Program Files\git\bin\bash.exe"", is there a way to reverse that? Was trying to install nvm and was trying to fix the bash issue.
EDIT: I just changed that with "npm config set script-shell "C:\WINDOWS\system32\cmd.exe"" and it brought me with this error:
C:\Users\weeseong.hew>npm install node-red-contrib-modbus
npm ERR! code ENOENT
npm ERR! syscall spawn =
npm ERR! path C:\Users\weeseong.hew\node_modules\@serialport\bindings
npm ERR! errno ENOENT
npm ERR! enoent spawn = ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Think i got it worse... should I consider reinstalling?
Yea think I had a typo when writing down that cmd. I've just reinstalled the whole node-red and it seems to be working now but it came to a problem which I can't seem to install node-red-contrib-modbus. It shows the following error:
2021-07-19T07:51:12.490Z Install : node-red-contrib-modbus 5.14.0
2021-07-19T07:51:12.493Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-modbus@5.14.0
2021-07-19T07:51:28.098Z [err] npm
2021-07-19T07:51:28.098Z [err] ERR!
2021-07-19T07:51:28.098Z [err] code ENOENT
2021-07-19T07:51:28.098Z [err] npm ERR!
2021-07-19T07:51:28.098Z [err] syscall spawn =
2021-07-19T07:51:28.098Z [err] npm
2021-07-19T07:51:28.098Z [err] ERR! path C:\Users\weeseong.hew\.node-red\node_modules\@serialport\bindings
2021-07-19T07:51:28.098Z [err] npm ERR!
2021-07-19T07:51:28.098Z [err] errno
2021-07-19T07:51:28.099Z [err] ENOENT
2021-07-19T07:51:28.103Z [err] npm
2021-07-19T07:51:28.103Z [err]
2021-07-19T07:51:28.104Z [err] ERR!
2021-07-19T07:51:28.104Z [err] enoent spawn = ENOENT
2021-07-19T07:51:28.104Z [err] npm ERR!
2021-07-19T07:51:28.104Z [err] enoent This is related to npm not being able to find a file.
2021-07-19T07:51:28.104Z [err] npm ERR! enoent
2021-07-19T07:51:28.149Z [err]
2021-07-19T07:51:28.149Z [err] npm ERR! A complete log of this run can be found in:
2021-07-19T07:51:28.149Z [err] npm ERR! C:\Users\weeseong.hew\AppData\Local\npm-cache\_logs\2021-07-19T07_51_28_112Z-debug.log
2021-07-19T07:51:28.200Z rc=1
Did you fully remove nodejs and npm first, including config files (wherever they are on Windows, I don't know)? I guess that there is still a hangover from when you used npm config set script-shell earlier. I suspect that is now set to an empty string so it can't find the shell command.
Hmmmm now that I've completely reinstalled the thing (not sure how much I have cleared up before reinstallation). Here's the error now when I was trying to install node-red-contrib-modbus:
-----------------------------------------------------------
2021-07-19T07:51:12.490Z Install : node-red-contrib-modbus 5.14.0
2021-07-19T07:51:12.493Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-modbus@5.14.0
2021-07-19T07:51:28.098Z [err] npm
2021-07-19T07:51:28.098Z [err] ERR!
2021-07-19T07:51:28.098Z [err] code ENOENT
2021-07-19T07:51:28.098Z [err] npm ERR!
2021-07-19T07:51:28.098Z [err] syscall spawn =
2021-07-19T07:51:28.098Z [err] npm
2021-07-19T07:51:28.098Z [err] ERR! path C:\Users\weeseong.hew\.node-red\node_modules\@serialport\bindings
2021-07-19T07:51:28.098Z [err] npm ERR!
2021-07-19T07:51:28.098Z [err] errno
2021-07-19T07:51:28.099Z [err] ENOENT
2021-07-19T07:51:28.103Z [err] npm
2021-07-19T07:51:28.103Z [err]
2021-07-19T07:51:28.104Z [err] ERR!
2021-07-19T07:51:28.104Z [err] enoent spawn = ENOENT
2021-07-19T07:51:28.104Z [err] npm ERR!
2021-07-19T07:51:28.104Z [err] enoent This is related to npm not being able to find a file.
2021-07-19T07:51:28.104Z [err] npm ERR! enoent
2021-07-19T07:51:28.149Z [err]
2021-07-19T07:51:28.149Z [err] npm ERR! A complete log of this run can be found in:
2021-07-19T07:51:28.149Z [err] npm ERR! C:\Users\weeseong.hew\AppData\Local\npm-cache\_logs\2021-07-19T07_51_28_112Z-debug.log
2021-07-19T07:51:28.200Z rc=1
If you try to install a different node do you get a similar error?
Did you find where the config files for npm are and make sure they got removed? It still appears to be trying to run a nothing command. Google found this for me, which might help Where is NPM config file windows?. Alternatively perhaps someone who knows about npm on windows can help.
Oddly enough, when I have to manually reinstall the other nodes for my palette, the error doesn't appear unless its the node-red-contrib-modbus and the node-red-contrib-uibuilder
EDIT: I should probably post this as well
-----------------------------------------------------------
2021-07-19T07:23:54.481Z Install : node-red-contrib-uibuilder 4.0.1
2021-07-19T07:23:58.852Z [err] npm
2021-07-19T07:23:58.852Z [err] ERR! code ENOENT
2021-07-19T07:23:58.852Z [err] npm ERR! syscall spawn =
2021-07-19T07:23:58.852Z [err] npm ERR! path C:\Users\weeseong.hew\.node-red\node_modules\node-red-contrib-uibuilder
2021-07-19T07:23:58.852Z [err] npm ERR! errno ENOENT
2021-07-19T07:23:58.856Z [err] npm ERR!
2021-07-19T07:23:58.856Z [err] enoent spawn = ENOENT
2021-07-19T07:23:58.856Z [err] npm ERR! enoent This is related to npm not being able to find a file.
2021-07-19T07:23:58.856Z [err] npm ERR! enoent
2021-07-19T07:23:58.883Z [err]
2021-07-19T07:23:58.883Z [err] npm ERR! A complete log of this run can be found in:
2021-07-19T07:23:58.883Z [err] npm ERR! C:\Users\weeseong.hew\AppData\Local\npm-cache\_logs\2021-07-19T07_23_58_857Z-debug.log
2021-07-19T07:23:58.915Z rc=1
That will likely because most nodes don't need to be built so it doesn't need a command shell. Possibly the easiest fix is to use the npm config command to tell it where the shell command actually is.