# NPM Command Not Found

**URL:** <https://discourse.nodered.org/t/npm-command-not-found/68426>\
**Category:** General\
**Created:** [30 September 2022 18:44 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426 "2022-09-30T18:44:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![noah911](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@noah911](https://discourse.nodered.org/u/noah911)\
**Post date:** [30 September 2022 18:44 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/1 "2022-09-30T18:44:25Z")

</div>

Hello! My name is Noah, a relatively new user to Node-red.

I am running into an issue, seemingly something to do with the file directories which node-red uses to run.

I am running on Windows 10 (21H1) with Node v16.17.1 and npm v8.15.0

I have tried 5 (or so) times to wipe and re-install Node.js after the following error when running node-red:

C:\WINDOWS\system32\>node-red  
30 Sep 14:29:34 - [info]

# Welcome to Node-RED

30 Sep 14:29:34 - [info] Node-RED version: v3.0.2  
30 Sep 14:29:34 - [info] Node.js version: v16.17.1  
30 Sep 14:29:34 - [info] Windows\_NT 10.0.19043 x64 LE  
30 Sep 14:29:34 - [info] Palette editor disabled : npm command not found  
30 Sep 14:29:34 - [info] Loading palette nodes  
30 Sep 14:29:35 - [info] Settings file : C:\Users\nomar.node-red\settings.js  
30 Sep 14:29:35 - [info] Context store : 'default' [module=memory]  
30 Sep 14:29:35 - [info] User directory : \Users\nomar.node-red  
30 Sep 14:29:35 - [warn] Projects disabled : editorTheme.projects.enabled=false  
30 Sep 14:29:35 - [info] Flows file : \Users\nomar.node-red\flows.json  
30 Sep 14:29:35 - [info] Creating new flow file  
30 Sep 14:29:35 - [warn]

If you did not catch it, the npm command is not found, meaning the palette editor is missing when I try to add modules to my flows.

So far, I have tried the following:

Adding the directory for npm-cli.js to the Path variable (via Windows System Environment Variables)  
Adding the directory for Program Files \> nodejs to the Path variable  
Adding the directory for .node-red to the Path variable

I have spent 6+ hours looking for a fix on forums, and have tried more than what is listed above.

This is the only system I run into this problem on. I have a RasPi running node-red fine as well as another Windows 10 system.

Any help would be much appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [30 September 2022 19:12 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/3 "2022-09-30T19:12:19Z")

</div>

What do you get when you run `npm -v` in the command prompt ?

---

<div class="post-metadata">

**Author:** ![noah911](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@noah911](https://discourse.nodered.org/u/noah911)\
**Post date:** [30 September 2022 19:21 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/4 "2022-09-30T19:21:52Z")

</div>

I get an error, see below:

```auto
node:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
node:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js'
←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:804:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: []
}

```

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [30 September 2022 19:28 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/5 "2022-09-30T19:28:10Z")

</div>

Since you are on windows

1. Uninstall nodejs
2. clean whatever Paths are related to nodejs and npm in Enviroment Variables (for User and System)
3. then try to re-install nodejs

---

<div class="post-metadata">

**Author:** ![paulkeates](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@paulkeates](https://discourse.nodered.org/u/paulkeates)\
**Post date:** [1 October 2022 19:16 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/6 "2022-10-01T19:16:05Z")

</div>

Hi,

I think this is a 'paths' issue. When you install Node JS on Windows you get a new Start menu item: Node.js. Within that there is a sub-menu to run the (properly configured) Node shell that you would then use to run Node-RED. It even displays in the header that it is properly configured to run Node applications.

Running a shell that starts in C:\WINDOWS\system32\> tells me you are not doing this.

I would NOT de-install / re-install until I'd tried those steps first - it possibly would work already, simply the paths are not configured as needed.

Cheers,

Paul

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [1 October 2022 19:25 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/7 "2022-10-01T19:25:27Z")

</div>

> [@paulkeates](#):
>
> I would NOT de-install / re-install until I'd tried those steps first

ok .. if it helps these are the nodejs and npm Paths in my Windows Environmental Variables

For User --\> Path  
`C:\Users\User\AppData\Roaming\npm`  
(replace **User** with your local user account)

For System --\> Path  
`C:\Program Files\nodejs\`

---

<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:** [1 October 2022 19:38 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/8 "2022-10-01T19:38:07Z")

</div>

> [@paulkeates](#):
>
> I think this is a 'paths' issue. When you install Node JS on Windows you get a new Start menu item: Node.js. Within that there is a sub-menu to run the (properly configured) Node shell that you would then use to run Node-RED. It even displays in the header that it is properly configured to run Node applications.

You don't need that if you installed node.js the way it is recommended on the node.js website. However, you do need to remember that updates to environment variables won't be seen in the current command line. You will need a new command line to see them.

If all else fails after installing node.js and it won't run in a new command line simply by typing `node`, log out and back in again.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 November 2022 19:38 UTC](https://discourse.nodered.org/t/npm-command-not-found/68426/9 "2022-11-30T19:38:39Z")

</div>

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