Upgrade problem: Node-RED is not yet fully installed

Did that - got this

Any errors will be logged to   /var/log/nodered-install.log


All done.
  You can now start Node-RED with the command  node-red-start
  or using the icon under   Menu / Programming / Node-RED
  Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started  Wed 19 Sep 11:33:57 BST 2018  -  Finished  Wed 19 Sep 11:41:47 BST 2018

pi@plinth:~ $ cd .node-red
pi@plinth:~/.node-red $ node-red
bash: node-red: command not found
pi@plinth:~/.node-red $ node-red-start

Node-RED is not yet fully installed

Fetching Node-RED update.

 
This script will remove versions of Node.js prior to version 6.x, and Node-RED and
if necessary replace them with Node.js 8.x LTS (carbon) and the latest Node-RED from Npm.
 
It also moves any Node-RED nodes that are globally installed into your user
~/.node-red/node_modules directory, and adds them to your package.json, so that
you can manage them with the palette manager.
 
It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.
 
To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.
 
Are you really sure you want to do this ? [y/N] ? 

Do I press y?

Yes otherwise it wonā€™t do anything

it just seems to be re-running the update script again

It just re-did the upgrade and cam back to the same question again

In my (no real clue, simple etc etc) mind - is it an node/npm issue?

The script doesn't seem to be creating a node-red or a node-red-pi entry in /usr/bin like my other Pi seem to have

I've got 2 new sd cards arriving today - so as soon as they come - I'll set them up and see what happens from a full clean base

after the latest upgrade what do node -v and npm -v report ?

I ran the install/upgrade script again (after clearing the npm cache and purging nodejs and npm), but still no luck.
In stead of:

Node-RED is not yet fully installed
This Node-RED install doesn't support using apt.

I now get into an endless loop of:

Node-RED is not yet fully installed
Fetching Node-RED update.

versions are now:

node -v
v8.12.0

npm -v
6.4.1

same versions as @willemx

@dceejay is it worth adding a note to the upgrade page in the docs, suggesting people don't currently upgrade?

Well of course I'm trying it locally and it's working fine here....

1 Like

have you got any Pi running older versions?

Is it possible to install something < 0.19.4 on a new card and then try the update script?

Nothing to do with Node-RED version... it's npm failing for some reason.

Not sure if it helps, but here is another log:

sudo cat /root/.npm/_logs/2018-09-19T11_12_49_127Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'i',
1 verbose cli   '-g',
1 verbose cli   '--unsafe-perm',
1 verbose cli   '--no-progress',
1 verbose cli   'node-red@latest' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose npm-session 5707cdbfa0265a3c
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 verbose stack TypeError: asyncWrite is not a function
7 verbose stack     at onwrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:480:7)
7 verbose stack     at WritableState.onwrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:180:5)
7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/cache.js:154:13)
7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js:35:13)
7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:428:64)
7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:417:5)
7 verbose stack     at WriteStream.Writable.write (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:334:11)
7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/cache.js:171:25)
7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js:35:13)
7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:428:64)
7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:417:5)
7 verbose stack     at WriteStream.Writable.write (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:334:11)
7 verbose stack     at WriteStream.to [as _worker] (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/cache.js:182:19)
7 verbose stack     at WriteStream._write (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js:35:13)
7 verbose stack     at doWrite (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:428:64)
7 verbose stack     at writeOrBuffer (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:417:5)
8 verbose cwd /home/pi
9 verbose Linux 4.14.69-v7+
10 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "--unsafe-perm" "--no-progress" "node-red@latest"
11 verbose node v8.12.0
12 verbose npm  v6.4.1
13 error asyncWrite is not a function
14 verbose exit [ 1, true ]

Just an idea: would it be an option to bundle each new node-red version with it's own carefully picked versions of node and npm?
Have a look here how Meteor does it.

The only slightly odd thing with your setup is that both node and npm are in /usr/local/... - the update script usually installs them in /usr instead (and wipes from /usr/local...) - If you apt-get purged them as per earlier then not sure why they would still be there.

We would like to think that the LTS versions are fairly stable - but...

I have been trying to get the installer working all morning. managed to do it by :-

sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/bin/npm

then re-run the node-red installer.

Thanks - anyone else want to try this ?

I tried @bradds method and it worked; I can now start node-red again.
Thanks!

Didn't seem to work for me :frowning:

Going round the loop again to see if lucky 2nd time

To know your npm global path may help:

npm root -g