# Npm install not working for only this node

**URL:** <https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824>\
**Category:** General\
**Created:** [27 February 2023 18:33 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824 "2023-02-27T18:33:26Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [27 February 2023 18:33 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/1 "2023-02-27T18:33:26Z")

</div>

i'm try install cast for node red using this comand:  
npm install node-red-contrib-cast

but i have this error:

````auto
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code sh ould use the URLSearchParams API instead.
npm ERR! code 1
npm ERR! path /root/.node-red/node_modules/protobufjs
npm ERR! command failed
npm ERR! command sh -c -- node scripts/postinstall
npm ERR! node:internal/modules/cjs/loader:998
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module '/root/.node-red/node_modules/protobufjs/scripts/postinst all'
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:841:27)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main: 81:12)
npm ERR! at node:internal/main/run_main_module:22:47 {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: []
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-02-27T18_23_24_188Z-debug-0.log```

only for this node!!
````

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [27 February 2023 19:29 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/2 "2023-02-27T19:29:01Z")

</div>

Try with `npm install --unsafe-perm`, according to the following [issue#877](https://github.com/protobufjs/protobuf.js/issues/877).

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [27 February 2023 19:55 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/3 "2023-02-27T19:55:43Z")

</div>

same error ☹

---

<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:** [27 February 2023 20:32 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/4 "2023-02-27T20:32:35Z")

</div>

I suspect this is related to your [other thread,](https://discourse.nodered.org/t/npm-install-node-red-contrib-fs-ops-not-installed/75808) to do with how you installed and are running node-red.

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [28 February 2023 16:20 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/5 "2023-02-28T16:20:56Z")

</div>

i'm formatting sd card and flash raspbian, i'm follow instruction for install node red but i can't install this node using this command:  
npm install node-red-contrib-cast

---

<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:** [28 February 2023 16:41 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/6 "2023-02-28T16:41:46Z")

</div>

what if you try to install the package that is failing yourself ?  
from .node-red folder `npm install protobufjs`  
if successful then re-run the installation of `npm install node-red-contrib-cast`

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [28 February 2023 16:43 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/7 "2023-02-28T16:43:44Z")

</div>

Hi!  
i'm try but receive same error ☹

---

<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:** [28 February 2023 18:17 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/8 "2023-02-28T18:17:09Z")

</div>

> [@Giacomo23](#):
>
> follow instruction for install node red

Exactly which instructions?

How are you starting node red?

The recommended instructions should not give you node red running as free root.

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [28 February 2023 18:25 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/9 "2023-02-28T18:25:23Z")

</div>

i'm using

```auto
node-red-pi --max-old-space-size=256

```

---

<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:** [28 February 2023 18:43 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/10 "2023-02-28T18:43:46Z")

</div>

Please try and answer all the questions, you still have not told us exactly how you installed node red.

> [@Giacomo23](#):
>
> `node-red-pi`

Which user are you logged in as when you run that?  
Do you use sudo to run it?

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [28 February 2023 18:47 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/11 "2023-02-28T18:47:21Z")

</div>

oh sorry, i'm run this command with user root without sudo

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [1 March 2023 08:08 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/12 "2023-03-01T08:08:37Z")

</div>

![11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/adf9de50fe0224f496b9dffb47cb67bbdff7e330.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [1 March 2023 08:13 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/13 "2023-03-01T08:13:09Z")

</div>

Sorry, but:

From this site:  
[https://nodered.org/docs/getting-started/raspberrypi](https://nodered.org/docs/getting-started/raspberrypi)

This command:  
`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)`

I would suggest removing what you have and starting again.

---

<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:** [1 March 2023 08:37 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/14 "2023-03-01T08:37:17Z")

</div>

> [@Giacomo23](#):
>
> i'm run this command with user root without sudo

1. Why are you running with user `root`???
2. Why in the next screen shot it shows you running `sudo npm install node-red-contrib-cast'? you just said you don't use `sudo`
3. When you refreshed the SD card, what user did you setup? If it was 'pi' then (unless you have extenuating reasons you haven't explained) you should run the bash script while signed in as the 'pi' user or the name of the user you chose.

Please open a terminal window and start node-red and copy the log from when you issue the `node-red` command to when you see the line:

```auto
1 Mar 03:34:44 - [info] Started flows

```

that. along with the answers to all the questions, will give us information to help you out.

---

<div class="post-metadata">

**Author:** ![Giacomo23](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@Giacomo23](https://discourse.nodered.org/u/Giacomo23)\
**Post date:** [1 March 2023 08:39 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/15 "2023-03-01T08:39:37Z")

</div>

thanks for all, i fix the problem update npm.  
Before check version with command

> npm -v

and then update using

> npm install -g npm@latest

(previous version 8.19.4)  
(current version 9.5.1)

---

<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:** [15 March 2023 08:40 UTC](https://discourse.nodered.org/t/npm-install-not-working-for-only-this-node/75824/16 "2023-03-15T08:40:36Z")

</div>

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