Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] the npm and nodejs debian11 repo didn't up-to-date #5467

Closed
2 tasks done
englianhu opened this issue Sep 4, 2022 · 1 comment
Closed
2 tasks done

[BUG] the npm and nodejs debian11 repo didn't up-to-date #5467

englianhu opened this issue Sep 4, 2022 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release

Comments

@englianhu
Copy link

englianhu commented Sep 4, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Default applications install from repo npm -v as 5.8.0 and node -v as v10.24.0 as we know from below.

:~$ sudo apt install *npm* -y
:~$ npm ci
npm WARN npm npm does not support Node.js v10.24.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 Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! path /home/englianhu/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/englianhu/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/englianhu/.npm/_logs/2022-09-04T08_10_21_933Z-debug.log
:~$ 
:~$ sudo apt install lib*node* -y
:~$ npm install node-latest-version --save
:~$ npm -v
5.8.0
:~$ node -v
v10.24.0
## ; copy and paste output from `npm config ls` here
:~$ npm config ls
npm WARN npm npm does not support Node.js v10.24.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 Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
; cli configs
metrics-registry = "https://registry.npmjs.org/"
scope = ""
user-agent = "npm/5.8.0 node/v10.24.0 linux x64"

; builtin config undefined
globalconfig = "/etc/npmrc"
globalignorefile = "/etc/npmignore"
prefix = "/usr/local"

; node bin location = /usr/bin/node
; cwd = /home/englianhu
; HOME = /home/englianhu
; "npm config ls -l" to show all defaults.
:~$ curl -qL https://www.npmjs.com/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--  100  3755  100  3755    0     0   6839      0 --:--:-- --:--:-- --:--:--  6827
fetching: https://registry.npmjs.org/npm/-/npm-8.19.1.tgz
removing existing npm
ERROR: npm is known not to run on Node.js v10.24.0
You'll need to upgrade to a newer Node.js version in order to use this
version of npm. You can find the latest version at https://nodejs.org/
failed!

Expected Behavior

update the libraries in debian11 repo accordingly...

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...
## https://nodejs.org/en
wget https://nodejs.org/dist/v18.8.0/node-v18.8.0-linux-x64.tar.xz
which node
# /usr/bin/node
which npm
# /usr/bin/npm

sudo rm -rf -R /usr/bin/node
sudo rm -rf -R /usr/lib/node
sudo rm -rf -R /usr/bin/npm
sudo tar -xf node-v18.8.0-linux-x64.tar.xz -C /usr/lib/
sudo rm -rf node-v18.8.0-linux-x64.tar.xz
sudo mv /usr/lib/node-v18.8.0-linux-x64 /usr/lib/node
sudo chmod 777 -R /usr/lib/node
sudo chmod 777 -R /usr/lib/npm
## /usr/lib/node/


## 方案 01
npm ci
npm config ls
curl -qL https://www.npmjs.com/install.sh | sh

echo "export PATH=/usr/lib/node/bin:${PATH}" | sudo tee /etc/profile.d/node.sh
source /etc/profile.d/node.sh
node -v


## 方案 02
echo "export PATH=/usr/lib/node/bin:${PATH}" | sudo tee -a $HOME/.profile #source
source $HOME/.profile
node -v

参考文献:

Just notice that npm also updated accordingly upon node.

:~$ which node
/usr/lib/node/bin/node
:~$ which npm
/usr/lib/node/bin/npm
:~$ npm -v
8.19.1
:~$ node -v
v18.8.0

Environment

  • npm: 8.19.1
  • Node.js: v18.8.0
  • OS Name: 🚩🇨🇳🏹红旗中科 RedFlag Linux (🍥Debian 11))
  • System Model Name:
  • npm config:
## ; copy and paste output from `npm config ls` here
:~$ which node
/usr/lib/node/bin/node
:~$ which npm
/usr/lib/node/bin/npm
:~$ npm -v
8.19.1
:~$ node -v
v18.8.0
:~$ npm config ls
; node bin location = /usr/lib/node/bin/node
; node version = v18.8.0
; npm local prefix = /home/englianhu
; npm version = 8.19.1
; cwd = /home/englianhu
; HOME = /home/englianhu
; Run `npm config ls -l` to show all defaults.
:~$ neofetch
        #####           englianhu@Scibrokes 
       #######          ------------------- 
       ##O#O##          OS: RedFlag Desktop 11.0 x86_64 
       #######          Host: 23-p080d 
     ###########        Kernel: 5.10.0-1-amd64 
    #############       Uptime: 5 days, 18 hours, 44 mins 
   ###############      Packages: 6913 (dpkg), 3 (snap) 
   ################     Shell: bash 5.0.3 
  #################     Resolution: 1920x1080 
#####################   DE: KDE 
#####################   WM: KWin 
  #################     Theme: RedFlag Dark [KDE], Breeze [GTK3] 
                        Icons: RedFlag-ND-72th-Anniversary [KDE], breeze  
                        Terminal: konsole 
                        CPU: Intel i5-4590T (4) @ 3.000GHz 
                        GPU: NVIDIA GeForce 710M 
                        GPU: Intel HD Graphics 
                        Memory: 9597MiB / 15901MiB 

                                                
@englianhu englianhu added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Sep 4, 2022
@ljharb
Copy link
Contributor

ljharb commented Sep 4, 2022

The Debian repo is entirely unofficial wrt node and npm; you’ll have to ask its maintainers to update it. npm is only officially distributed on npm, with node, and as an install script; node is only officially distributed via its website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

No branches or pull requests

2 participants