Hi all, thank you in advance for the assistance and please pardon the long post!
Could someone please detail, or refer me to, the process for removing and reinstalling Node, and Node Red? BUT, I don't want to lose the progress I've made and so I'm afraid to undo the progress I've made (esp after bricking my Pi last week!) I'm quite new to RaspPi, linux, node, and node red and have made strides but have hamstrung myself - by likely installing node twice (as both root and user). And, I'm unclear on the processes because there's conflicting info I find (which often is OS dependent it seems, or quite dated).
After "bricking" the Pi and starting over, I have a critical project coming on deadline, please help!
I tried this solution detailed here to copy my
My current situation with versions which I think indicate I've screwed up the installation...
....Bash history log attached
bash_history.pdf (26.3 KB)
pi@raspberrypi:~ $ which node-red
pi@raspberrypi:~ $ sudo which node-red
pi@raspberrypi:~ $ which node
pi@raspberrypi:~ $ sudo which node
pi@raspberrypi:~ $ node -v
pi@raspberrypi:~ $ sudo node -v
pi@raspberrypi:~ $ npm -v
pi@raspberrypi:~ $ sudo npm -v
pi@raspberrypi:~ $ which npm
pi@raspberrypi:~ $ sudo which npm
When trying to install some packages, I'm getting errors like:
pi@raspberrypi:~ $ sudo npm install i2c-bus
firstname.lastname@example.org install /home/pi/node_modules/i2c-bus
gyp WARN EACCES current user ("pi") does not have permission to access the dev dir "/root/.cache/node-gyp/10.22.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/node_modules/i2c-bus/.node-gyp"
make: Entering directory '/home/pi/node_modules/i2c-bus/build'
make: Leaving directory '/home/pi/node_modules/i2c-bus/build'
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.
updated 1 package and audited 345 packages in 13.637s
-------------------------------------------------------------SECOND INSTANCE-----------------------------------------2020-10-11T16:40:50.830Z Install : node-red-contrib-easybotics-vl53l0x 0.0.3
2020-10-11T16:40:50.860Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production email@example.com
2020-10-11T16:41:00.837Z [err] npm
2020-10-11T16:41:00.838Z [err] ERR! code ELOOP
2020-10-11T16:41:00.838Z [err] npm
2020-10-11T16:41:00.838Z [err] ERR! syscall open
2020-10-11T16:41:00.838Z [err] npm ERR!
2020-10-11T16:41:00.838Z [err] path /home/pi/.node-red/node_modules/serialport/npm-shrinkwrap.json
2020-10-11T16:41:00.839Z [err] npm
2020-10-11T16:41:00.839Z [err] ERR! errno -40
2020-10-11T16:41:00.842Z [err] npm
2020-10-11T16:41:00.842Z [err] ERR! ELOOP: too many symbolic links encountered, open '/home/pi/.node-red/node_modules/serialport/npm-shrinkwrap.json'
2020-10-11T16:41:00.861Z [err] npm ERR! A complete log of this run can be found in:
2020-10-11T16:41:00.861Z [err] npm
2020-10-11T16:41:00.861Z [err] ERR! /home/pi/.npm/_logs/2020-10-11T16_41_00_845Z-debug.log
...this "too many symbolic links" error is preventing several packages from installing which seems connected to the missing files that are supposed to be there (see highlighted above) and has been part of every packages install (npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json') - I assume this is an issue with the the conflicting versions, or placement (user v root)
- Am I right in assuming this is a case of conflicting software?
- Therefore, can I simply delete and reinstall node/npm and node red correctly?
** (defintely would rather install without NVM as I was trying to solve another issue when using nvm but I think that is causing more issues with the current node/pi setup)
- If so, how can I preserve my currently installed node modules?
- I would like to use the "official" nodered install package noted here - could I uninstall and then use this install package w/out conflicts?
*Do I need to cd ~/pi/.node-red to run npm install [package]?
Currently referring to these links for ref but I lack confidence in parsing them for my situation:
^^but 2015! ...still relevant??
This is my pi (Raspberry Pi 4) info on boot:
pi@raspberrypi:~ $ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.51-v7l+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1333 SMP Mon Aug 10 16:51:40 BST 2020
[ 0.000000] CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d
pi@raspberrypi:~ $ nvm ls
default -> v14.5.0
node -> stable (-> v14.5.0) (default)
stable -> 14.5 (-> v14.5.0) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/erbium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.22.1 (-> N/A)
lts/erbium -> v12.19.0 (-> N/A)