mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

update node.js problem

Fri Jul 23, 2021 5:52 pm

Hi
Your advise please for the problem below when try to install serial port node to RPI3

npm install node-red -node-serialport
npm WARN npm npm does not support Node.js v8.12.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! URL is not defined

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2021-07-23T17_24_24_847Z-debug.log

I have node -v
v8.12.0

and
npm -v
npm WARN npm npm does not support Node.js v8.12.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
7.20.1

I have searched on some forums and tried to get some commands to solve my problem but i got as below :

pi@pi:~ $ npm install node-red-node-serialport
bash: npm: command not found
pi@pi:~ $ sudo apt install build-essential git curl
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
pi@pi:~ $ apt-get install nodered
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
pi@pi:~ $ sudo apt-get update
E: Malformed line 8 in source list /etc/apt/sources.list (URI)
E: The list of sources could not be read.
pi@pi:~ $ sudo apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
pi@pi:~ $ sudo apt install build-essential git
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
pi@pi:~ $

RonR
Posts: 2385
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: update node.js problem

Sat Jul 24, 2021 12:32 am

You might consider installing the currently recommended version (14.x):

Code: Select all

sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get -y install nodejs

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Sat Jul 24, 2021 2:14 pm

Hi
I got as below :
sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -


## Installing the NodeSource Node.js 14.x repo...


## Populating apt-get cache...

+ apt-get update
E: Malformed line 8 in source list /etc/apt/sources.list (URI)
E: The list of sources could not be read.
Error executing command, exiting
pi@pi:~ $ sudo apt-get -y install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.


also when I did update command I got :
sudo apt update
E: Malformed line 8 in source list /etc/apt/sources.list (URI)
E: The list of sources could not be read.

RonR
Posts: 2385
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: update node.js problem

Sat Jul 24, 2021 5:37 pm

mustafasei wrote:
Sat Jul 24, 2021 2:14 pm
E: Malformed line 8 in source list /etc/apt/sources.list (URI)
E: The list of sources could not be read.

...

E: Malformed line 8 in source list /etc/apt/sources.list (URI)
E: The list of sources could not be read.

Did you look at line 8 in source list /etc/apt/sources.list to see what is malformed?

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Mon Jul 26, 2021 10:04 am

No I have no experience in such field
Can you please advise about that

User avatar
rpdom
Posts: 19044
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: update node.js problem

Mon Jul 26, 2021 12:11 pm

mustafasei wrote:
Mon Jul 26, 2021 10:04 am
Can you please advise about that
Not unless you show us what you have in that file.

This is what I have in my default file:

Code: Select all

pi@raspberrypi:~ $ cat /etc/apt/sources.list
deb http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
# Uncomment deb-src lines below then 'apt-get update' to enable 'apt-get source'
#deb-src http://deb.debian.org/debian buster main contrib non-free
#deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free
#deb-src http://deb.debian.org/debian buster-updates main contrib non-free
You probably have something extra for node installation and have mistyped it or it has become corrupted somehow.
Unreadable squiggle


User avatar
rpdom
Posts: 19044
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: update node.js problem

Tue Jul 27, 2021 3:38 pm

mustafasei wrote:
Tue Jul 27, 2021 1:54 pm
below is the list :

Code: Select all

cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb
binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
deb http://feeds.labviewmakerhub.com/debian/ binary/
That looks quite messed up to me. Most of the lines are the same. There should be only one line per source location. Line 8 and 9 are very wrong. If you need that "labviewhub" entry, I'd change the file to look like this:

Code: Select all

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://feeds.labviewmakerhub.com/debian/ binary/
Unreadable squiggle

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Tue Jul 27, 2021 4:52 pm

How can I change it please ? I have no experience in programming of RPI
appreciate it you guide me step by step

User avatar
rpdom
Posts: 19044
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: update node.js problem

Tue Jul 27, 2021 6:40 pm

If you type

Code: Select all

sudo nano /etc/apt/sources.list
There are a few ways to do this. the most common is to use sudo nano /etc/apt/sources.list to let you edit the file, delete the lines you don't need, and the save the file by pressing Ctrl-o to "Write Out", then Ctrl-x to "Exit) as shown at the bottom of the editor screen.

Another method is to use something like sudo sed -i 5,18d /etc/apt/sources.list which will just delete lines 5 to 18 of that file for you.
Last edited by rpdom on Tue Jul 27, 2021 7:11 pm, edited 1 time in total.
Unreadable squiggle

jbudd
Posts: 1893
Joined: Mon Dec 16, 2013 10:23 am

Re: update node.js problem

Tue Jul 27, 2021 6:51 pm

This may be a dumb suggestion since I'm not clear of the difference between node.js and node-red.

If you are using node-red, the best way to install and update it is with the script on the nodered.org getting started page.

And with the current version you can install additional nodes from within node-red via hamburger menu/manage palette.

ps maybe try it on a new SD card first, using Buster. You seem to be still on Jessie?

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Tue Jul 27, 2021 7:08 pm

I got as below
sed -i 5,18d /etc/apt/sources.list
sed: couldn't open temporary file /etc/apt/sedhrErG9: Permission denied

User avatar
rpdom
Posts: 19044
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: update node.js problem

Tue Jul 27, 2021 7:12 pm

mustafasei wrote:
Tue Jul 27, 2021 7:08 pm
sed -i 5,18d /etc/apt/sources.list
sed: couldn't open temporary file /etc/apt/sedhrErG9: Permission denied
Sorry, my fault. I forgot to say you need to put sudo in front of the sed command. I have corrected my previous post.
Unreadable squiggle

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Thu Jul 29, 2021 9:04 pm

Hi
It is work perfectly now and thank you for your help
now I got new issue after do full upgrade I lost the connection with wifi even after resend the supplicant.conf file to SD card still no wifi connection

Any advice please

jbudd
Posts: 1893
Joined: Mon Dec 16, 2013 10:23 am

Re: update node.js problem

Thu Jul 29, 2021 9:06 pm

Show us your wpa_supplicant.conf.

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Fri Jul 30, 2021 9:44 am

Shall I attached the .conf file or a picture to a command??

jbudd
Posts: 1893
Joined: Mon Dec 16, 2013 10:23 am

Re: update node.js problem

Fri Jul 30, 2021 1:05 pm

Either copy and paste the text, or a picture. Easier to censor your SSID and password in text form.

mustafasei
Posts: 23
Joined: Mon May 14, 2018 3:11 pm

Re: update node.js problem

Fri Jul 30, 2021 2:28 pm

country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
scan_ssid=1
ssid="****"
psk="*****"
}


I was following the video and post below but I found as per picture

https://www.youtube.com/watch?v=V1j-mnofPpk
viewtopic.php?t=124069

jbudd
Posts: 1893
Joined: Mon Dec 16, 2013 10:23 am

Re: update node.js problem

Fri Jul 30, 2021 2:42 pm

country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant
My wpa_supplicant.conf file (Buster not Jessie) has this:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

I don't know if the country code has to be upper case but certainly worth trying US
Your ctrl_interface is missing "DIR=" and GROUP=netdev

Return to “Beginners”