Bug 33601 - npm: update fails
Summary: npm: update fails
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-02 10:25 CEST by Marc Krämer
Modified: 2026-04-01 17:59 CEST (History)
3 users (show)

See Also:
Source RPM: nodejs-22.6.0-1.mga9.src.rpm
CVE:
Status comment:


Attachments

Description Marc Krämer 2024-10-02 10:25:45 CEST
LANG=C urpmi --auto-select 
To satisfy dependencies, the following package is going to be installed:
  Package                        Version      Release       Arch    
(medium "Core Updates")
  npm                            10.8.2       1.22.6.0.1.m> x86_64  
875KB of disk space will be freed.
1.8MB of packages will be retrieved.
Proceed with the installation of one package? (Y/n) 


    http://ftp-stud.hs-esslingen.de/pub/Mirrors/Mageia/distrib/9/x86_64/media/core/updates/npm-10.8.2-1.22.6.0.1.mga9.x86_64.rpm
installing npm-10.8.2-1.22.6.0.1.mga9.x86_64.rpm from /var/cache/urpmi/rpms                                                                                                                                                                  
Preparing...                     ###########################################################################################################################################################################################################
      1/1: npm                   ###########################################################################################################################################################################################################
error: unpacking of archive failed on file /usr/lib/node_modules/npm/docs;66fd02be: cpio: File from package already exists as a directory in system
ERROR: 'unpack' failed for npm-1:10.8.2-1.22.6.0.1.mga9.x86_64
error: npm-1:10.8.2-1.22.6.0.1.mga9.x86_64: install failed
error: npm-1:9.8.1-1.18.18.2.1.mga9.x86_64: erase skipped



I guess some npm update was run directly by npm.
- this should be compatible to the direct updates

Since we don't ship updates very often, and the development on the web is faster, out of band updates are needed to run some npm software....
Comment 1 sturmvogel 2024-10-02 16:26:43 CEST
History bug 29833
Comment 2 Lewis Smith 2024-10-07 10:34:21 CEST
This does look like a duplicate of the earlier bug, which ends:
"removed the files and did the update, let's see if this comes again. closing for now."

This version 22.6.0 of nodejs (which contains v10.8.2 of npm, 1.22.6.0.1.mga9) was updated in August. This is recent.

"I guess some npm update was run directly by npm"
Are you saying that npm automatically updates itself?
I still think it is asking for trouble to update a Mageia package directly from upstream, then do a Mageia update. What is urpmi going to make of it?

"Since we don't ship updates very often, and the development on the web is faster, out of band updates are needed to run some npm software."
If you know of a necessary npm update [not automatically done], would it not be possible to raise a bug asking for nodejs to be updated to include it?

Source RPM: npm => nodejs-22.6.0-1.mga9.src.rpm
CC: (none) => lewyssmith

Comment 3 Lewis Smith 2024-10-07 10:36:21 CEST
Once the situation is clarified, this looks good for discussion on the dev mailList.
Comment 4 Marc Krämer 2024-10-07 10:49:24 CEST
> "I guess some npm update was run directly by npm"
> Are you saying that npm automatically updates itself?
> I still think it is asking for trouble to update a Mageia package directly
> from upstream, then do a Mageia update. What is urpmi going to make of it?
sure. If you install/update some packages not present in mga (e.g. eslint), you have to run npm update, which installs the latest version of npm.
Comment 5 Lewis Smith 2024-10-07 11:00:45 CEST
So, can you ask among devs what they think?
Comment 6 Jean Michel Varvou 2025-05-28 21:00:37 CEST
I have today the same problem with the last update :

    https://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/9/x86_64/media/core/updates/npm-10.9.2-1.22.16.0.1.mga9.x86_64.rpm
installation de npm-10.9.2-1.22.16.0.1.mga9.x86_64.rpm depuis /var/cache/urpmi/rpms                                                                                                                                                                        
Préparation...                   #########################################################################################################################################################################################################################
      1/1: npm                   #########################################################################################################################################################################################################################
erreur : échec du déballage de l'archive  dans fichier /usr/lib/node_modules/npm/docs;68375b48 : cpio: File from package already exists as a directory in system
ERROR: 'unpack' failed for npm-1:10.9.2-1.22.16.0.1.mga9.x86_64
erreur : npm-1:10.9.2-1.22.16.0.1.mga9.x86_64: installer échoué
erreur : npm-1:10.9.2-1.22.13.1.2.mga9.x86_64: effacer sauté

CC: (none) => jeanmichel.varvou

Comment 7 Jean Michel Varvou 2025-05-28 21:03:17 CEST
Hi

I got around the problem by doing: :
rm -fr /usr/lib/node_modules/npm 

Then I resinstall npm
Comment 8 Florian Hubold 2026-04-01 17:59:17 CEST
(In reply to Lewis Smith from comment #2)
> This does look like a duplicate of the earlier bug, which ends:
> "removed the files and did the update, let's see if this comes again.
> closing for now."

As this is reproducible and happened for multiple users, this might be a packaging issue. Cf. https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/

CC: (none) => doktor5000


Note You need to log in before you can comment on or make changes to this bug.