# Npm error when installing beta

**URL:** <https://discourse.nodered.org/t/npm-error-when-installing-beta/11710>\
**Category:** General\
**Created:** [30 May 2019 18:55 UTC](https://discourse.nodered.org/t/npm-error-when-installing-beta/11710 "2019-05-30T18:55:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvanklink](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pvanklink](https://discourse.nodered.org/u/pvanklink)\
**Post date:** [30 May 2019 18:55 UTC](https://discourse.nodered.org/t/npm-error-when-installing-beta/11710/1 "2019-05-30T18:55:40Z")

</div>

Hi i installed node-red version v 0.20.5 on a raspberry pi 3b+ with the latest raspbian stretch desktop  
with this command:  
bash \<(curl -sL [https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered))

When i enter to upgrade to the latest beta:  
sudo npm install -g --unsafe-perm node-red@next  
i get: sudo: npm: opdracht niet gevonden

i read that i had to specify @next, do i have to type something else, so what?

@update  
Hi i installed node-red version v 0.20.5 on a raspberry pi 3b+ with the latest raspbian stretch desktop  
with this command:  
bash \<(curl -sL [https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered))

When i enter to upgrade to the latest beta:  
sudo npm install -g --unsafe-perm node-red@next  
i get: sudo: npm: opdracht niet gevonden

i read that i had to specify @next, do i have to type something else, so what?

i did  
$ sudo apt-get install npm

and then i tried again  
sudo npm install -g --unsafe-perm node-red@next

npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "--unsafe-perm" " node-red@next"  
npm ERR! cwd /usr/local/bin  
npm ERR! node -v v8.11.1  
npm ERR! npm -v 1.4.21  
npm ERR! code E405  
npm ERR!  
npm ERR! Additional logging details can be found in:  
npm ERR! /usr/local/bin/npm-debug.log  
npm ERR! not ok code 0

and then again:

- the above bashscript
- sudo npm install -g --unsafe-perm node-red@next

and now it works!

---

<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:** [30 May 2019 20:30 UTC](https://discourse.nodered.org/t/npm-error-when-installing-beta/11710/2 "2019-05-30T20:30:07Z")

</div>

It should not have been necessary to install npm using apt, it should have been installed by the script. I suggest you uninstall it and run the script again.  
Do you see any errors on the terminal?  
If not then what do these commands show

```bash
apt-cache policy nodejs
node -v
npm -v

```

---

<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:** [31 May 2019 07:58 UTC](https://discourse.nodered.org/t/npm-error-when-installing-beta/11710/3 "2019-05-31T07:58:38Z")

</div>

Just noticed that you have recovered the situation by running the script again.
