# Erreur lors de l'installation de node-red sur Windows

**URL:** <https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296>\
**Category:** General\
**Created:** [14 April 2022 13:55 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296 "2022-04-14T13:55:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayelle.26](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mayelle.26](https://discourse.nodered.org/u/mayelle.26)\
**Post date:** [14 April 2022 13:55 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/1 "2022-04-14T13:55:37Z")

</div>

Bonjour,  
Je suis sous Windows et j'ai essayé d'installer node-red via node.js directement. Sauf que lorsque je lance l'installation j'obtiens des erreurs (ci dessous). La version de node est 17.9.0 et celle de npm est 8.6.0

```auto
node:internal/fs/utils:345
    throw err;
    ^

Error: EPERM: operation not permitted, mkdir 'C:\Users\cardr\.node-red'
    at Object.mkdirSync (node:fs:1350:3)
    at module.exports.makeDirSync (C:\Users\cardr\AppData\Roaming\npm\node_modules\node-red\node_modules\fs-extra\lib\mkdirs\make-dir.js:23:13)
    at handleFilterAndCopy (C:\Users\cardr\AppData\Roaming\npm\node_modules\node-red\node_modules\fs-extra\lib\copy-sync\copy-sync.js:32:35)
    at Object.copySync (C:\Users\cardr\AppData\Roaming\npm\node_modules\node-red\node_modules\fs-extra\lib\copy-sync\copy-sync.js:26:10)
    at Object.<anonymous> (C:\Users\cardr\AppData\Roaming\npm\node_modules\node-red\red.js:125:20)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  errno: -4048,
  syscall: 'mkdir',
  code: 'EPERM',
  path: 'C:\\Users\\cardr\\.node-red'
}
Node.js v17.9.0

```

Je suis nouvelle dans ce domaine, si vous avez une solution merci pour votre aide!

---

<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:** [14 April 2022 19:16 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/2 "2022-04-14T19:16:48Z")

</div>

I think that the latest officially supported version of node.js is 16. Odd numbered versions are often considered development or at least have short lifespans and not generally recommended for live use.

How are you installing node-red? What is the process and where are you installing it? Are you using a global install? Are you using sudo?

If you are installing locally rather than globally, have you looked at my alternate installer repo on GitHub, that gives some clues as to the correct method.

---

<div class="post-metadata">

**Author:** ![mayelle.26](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mayelle.26](https://discourse.nodered.org/u/mayelle.26)\
**Post date:** [15 April 2022 06:26 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/3 "2022-04-15T06:26:21Z")

</div>

Merci pour votre réponse!  
J'ai aussi essayé avec la version 16 mais cela me donne les mêmes erreurs.  
Pour installer node-red je télécharge le node.js, j’exécute le téléchargement, ensuite j'utilise  
`npm install -g --unsafe-perm node-red `  
dans mon invité de commande (cela me donne déjà des erreurs) et je met ensuite  
|``node-red``` qui me donne aussi des erreurs. Je n'utilise pas sudo, et oui je l'installe localement.  
Je vais consulter votre alternatif sur GitHub, avez-vous un lien?

---

<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:** [15 April 2022 08:45 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/4 "2022-04-15T08:45:08Z")

</div>

> [@mayelle.26](#):
>
> `Error: EPERM: operation not permitted, mkdir 'C:\Users\cardr\.node-red'`

There is a permissions issue.

Check the permissions on `C:\Users\cardr\.node-red` include read & write for user `cardr`

---

<div class="post-metadata">

**Author:** ![mayelle.26](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mayelle.26](https://discourse.nodered.org/u/mayelle.26)\
**Post date:** [15 April 2022 09:13 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/6 "2022-04-15T09:13:04Z")

</div>

Merci pour votre réponse mais ça ne change rien.

```auto
C:\Users\cardr>npm install -g --unsafe-perm node-red

changed 301 packages, and audited 302 packages in 14s

31 packages are looking for funding
  run `npm fund` for details

3 high severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

```

---

<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:** [15 April 2022 09:20 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/7 "2022-04-15T09:20:13Z")

</div>

That install looks normal. What happens when you run `node-red`?

---

<div class="post-metadata">

**Author:** ![mayelle.26](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mayelle.26](https://discourse.nodered.org/u/mayelle.26)\
**Post date:** [15 April 2022 09:25 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/8 "2022-04-15T09:25:02Z")

</div>

cela me donne:

```auto
C:\Users\cardr>node-red
15 Apr 11:24:01 - [warn] Flushing file C:\Users\cardr\.node-red\package.json to disk failed : Error: EPERM: operation not permitted, rename 'C:\Users\cardr\.node-red\package.json.$$$' -> 'C:\Users\cardr\.node-red\package.json'
15 Apr 11:24:01 - [error] Failed to start server:
15 Apr 11:24:01 - [error] Error: EPERM: operation not permitted, rename 'C:\Users\cardr\.node-red\package.json.$$$' -> 'C:\Users\cardr\.node-red\package.json'

```

---

<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:** [15 April 2022 09:31 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/9 "2022-04-15T09:31:31Z")

</div>

I suggest you restart the computer, delete (or rename) the folder `C:\Users\cardr\.node-red` then try launching node-red once more.

There is something wrong with the permissions on that folder or the files within that folder. Deleting it will cause it to be recreated when you run node red once more. If you have important files or flows inside of the `C:\Users\cardr\.node-red` folder, make sure you back them up before you delete it.

---

<div class="post-metadata">

**Author:** ![mayelle.26](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mayelle.26](https://discourse.nodered.org/u/mayelle.26)\
**Post date:** [15 April 2022 10:04 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/10 "2022-04-15T10:04:07Z")

</div>

J'ai enfin réussi à executer node.red, je me suis rendu compte que `package.json, .config.nodes.json, config.users.json, .config.runtime.json `  
arrivé sous la forme ` package.json.$$$, config.nodes.json.$$$, config.users.json.$$$, config.runtime.json.$$$`je les ai donc renommé.  
Cela est étrange.  
Merci pour votre aide!

---

<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:** [15 April 2022 10:29 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/11 "2022-04-15T10:29:47Z")

</div>

> [@mayelle.26](#):
>
> To install node-red I download the node.js, I run the download, then I use‎  
> `npm install -g --unsafe-perm node-red `  
> ‎in my command prompt (this already gives me errors) and then‎  
> ‎ I put | ''node-red''' which also gives me errors. I don't use sudo, and yes I install it locally.

That command installs node-red globally not locally. Sorry, missed that you were on Windows. Do you run that command from an elevated command prompt? (Hint: you shouldn't if you are).

The fact that you can't use the `node-red` command I think indicates that the install hasn't done what you think. To be honest though, I never install node-red with `-g` (global) except for testing. and I never use the `node-red` command so I'm not sure how that works on Windows.

Installing locally means not using the `-g`. This is a more normal style of node.js app installation. You create a folder `cd` into the folder and then `npm install node-red --production --unsafe-perm`. You then use the usual `~/.node-red` userDir folder if you like but I prefer to create a userDir folder which I normally call `data` as a sub-folder of where I've installed node-red. This keeps everything in 1 place and makes it all both easy to remember, easy to find and easy to back up. OCD at its finest! 🙂 It also means that you can easily create multiple instances of node-red with different versions of node-red itself - great for testing. The final potential advantage is that the location and running only need standard user accounts and don't accidentally give root access. So I also run my live home automation server the same way.

> **[GitHub - TotallyInformation/alternate-node-red-installer: An alternative...](https://github.com/TotallyInformation/alternate-node-red-installer)**
>
> An alternative installer for Node-RED. Avoids global installs, no admin rights required. - GitHub - TotallyInformation/alternate-node-red-installer: An alternative installer for Node-RED. Avoids gl...

That is just some helpers, mainly a script and some template files. It isn't meant to be a complete solution, just makes it a bit easier to be consistent. It uses the rules I've just described.

---

<div class="post-metadata">

**Author:** ![mayelle.26](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@mayelle.26](https://discourse.nodered.org/u/mayelle.26)\
**Post date:** [15 April 2022 12:03 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/12 "2022-04-15T12:03:04Z")

</div>

Great, thank you for your very complete answer, I admit that this technology is a bit beyond me, but it helps me! And I find that there is a lot of mutual aid at this level!  
Thank you again for your answers.

---

<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:** [14 June 2022 12:03 UTC](https://discourse.nodered.org/t/erreur-lors-de-linstallation-de-node-red-sur-windows/61296/13 "2022-06-14T12:03:12Z")

</div>

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