# Node.js ENOENT Error

**URL:** <https://discourse.nodered.org/t/node-js-enoent-error/48567>\
**Category:** General\
**Created:** [19 July 2021 06:52 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567 "2021-07-19T06:52:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [19 July 2021 06:52 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/1 "2021-07-19T06:52:42Z")

</div>

Hi, I was working on downgrading the node.js version and after all that i came across this error.

```auto
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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 July 2021 07:08 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/2 "2021-07-19T07:08:01Z")

</div>

> [@WeeSeong](#):
>
> npm ERR! syscall spawn C:\Program Filed\git\bin\bash.exe

I imagine that should be `Program Files` not `Program Filed`. As to why it is looking there I have no idea. Something on your system is messed up.

As a secondary issue you should be installing from your `.node-red` folder not your user folder.

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [19 July 2021 07:54 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/3 "2021-07-19T07:54:02Z")

</div>

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:

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 July 2021 07:56 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/4 "2021-07-19T07:56:43Z")

</div>

> [@WeeSeong](#):
>
> 2021-07-19T07:51:28.098Z [err] syscall spawn =

That is still not correct. Did you follow the instructions for [installing on Windows](https://nodered.org/docs/getting-started/windows) in the node-red docs?

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [19 July 2021 08:05 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/5 "2021-07-19T08:05:22Z")

</div>

Yeah, I did the exact same step to install the node-red.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 July 2021 08:34 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/6 "2021-07-19T08:34:28Z")

</div>

> [@WeeSeong](#):
>
> C:\Users\weeseong.hew.node-red\node\_modules

That path looks wrong. The `.node-red` should be a folder on it’s own.

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [19 July 2021 08:40 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/7 "2021-07-19T08:40:56Z")

</div>

If i'm not wrong, that should be C:\Users\weeseong.hew.node-red\node\_modules right? How do I change that?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 July 2021 08:46 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/8 "2021-07-19T08:46:44Z")

</div>

I’m not a windows user but on the other platforms node-red gets installed in a folder called `.node-red` that is in the users folder.

On a pi it would be; /home/pi/.node-red  
On a Mac it would be /Users/Myname/.node-red

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 July 2021 09:00 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/9 "2021-07-19T09:00:48Z")

</div>

The OP isnt formatting his pasted code and paths as code and the forum is seeing the `\` as an escape and messing up the output.

For example, where he wrote

> [@WeeSeong](#):
>
> If i'm not wrong, that should be C:\Users\weeseong.hew.node-red\node\_modules right?

If he used the code format button that would read `C:\Users\weeseong.hew\.node-red\node_modules\`

@WeeSeong please ensure you post correctly formatted code/logs/paths. it is important to surround your code with three backticks  
`````  
`like this`  
`````

You can edit and correct your post by clicking the pencil icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 July 2021 09:36 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/10 "2021-07-19T09:36:04Z")

</div>

> [@WeeSeong](#):
>
> I did the exact same step to install the node-red.

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.

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [19 July 2021 09:43 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/11 "2021-07-19T09:43:36Z")

</div>

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:

```auto
-----------------------------------------------------------
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

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 July 2021 09:53 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/12 "2021-07-19T09:53:56Z")

</div>

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?](https://askinglot.com/where-is-npm-config-file-windows). Alternatively perhaps someone who knows about npm on windows can help.

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [19 July 2021 09:58 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/13 "2021-07-19T09:58:32Z")

</div>

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

```auto
-----------------------------------------------------------
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

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 July 2021 10:01 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/14 "2021-07-19T10:01:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 July 2021 10:49 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/15 "2021-07-19T10:49:08Z")

</div>

> [@WeeSeong](#):
>
> npm config set script-shell "C:\WINDOWS\system32\cmd.exe

Not sure why you have messed with this? The default configuration works just fine.

```powershell
> npm config get script-shell
null

```

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [21 July 2021 00:56 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/16 "2021-07-21T00:56:18Z")

</div>

I've tried that, and it shows something like this:

```auto
C:\Users\weeseong.hew>npm config get script-shell
=

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 July 2021 04:08 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/17 "2021-07-21T04:08:25Z")

</div>

That needs to be null or the correct path.

---

<div class="post-metadata">

**Author:** ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)\
**Post date:** [21 July 2021 06:08 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/18 "2021-07-21T06:08:03Z")

</div>

How do I set that? Because it skipped the '=' part so I can't key in anything

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 July 2021 07:29 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/19 "2021-07-21T07:29:24Z")

</div>

No idea, read the docs maybe.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 July 2021 20:12 UTC](https://discourse.nodered.org/t/node-js-enoent-error/48567/20 "2021-07-21T20:12:53Z")

</div>

I think you can edit the file by hand. It should be somewhere in the npm docs.

[Next page](https://discourse.nodered.org/t/node-js-enoent-error/48567.md?page=2)
