[arch-general] "npm" package issues

eye at eyenx.ch eye at eyenx.ch
Wed Nov 4 12:39:40 UTC 2020


Hi Greg

> first off, i wonder if anyone has ideas of how i ended up in this
> situation?  i know that occasionally npm will exclaim, with enthusiasm,
> that a new, updated version, is available, and offer me a chance to
> update it.  normally i don't run as root.  but, if i had, in the past,
> sudo'd npm, and let it update itself, might *that* have produced this?

Did you install npm packages with the `-g` flag?

from the manpage:

```
• global mode: npm installs packages into the install prefix at
prefix/lib/node_modules and bins are installed in prefix/bin.
```

Regards -- Toni

On 11/04 10:56, Greg Minshall via arch-general wrote:
> hi.  [hope all are well, etc.]
> 
> i use the npm package (for managing javascript packages).
> 
> today i tried "pacman -Syu", and i got a number of errors about files
> under /usr/lib/node_modules/npm/node_modules that "exists in
> filesystem":
> ----
> (182/182) checking for file conflicts
> error: failed to commit transaction (conflicting files)
> npm: /usr/lib/node_modules/npm/node_modules/meant/.github/workflows/ci.yml exists in filesystem
> npm: /usr/lib/node_modules/npm/node_modules/minimist/.travis.yml exists in filesystem
> ... (about minimist)
> ----
> 
> these are files that are not owned by the npm package.  the relevant
> find command
> 
> : find /usr/lib/node_modules/npm/node_modules/ -exec pacman -Qo {} \; |
> :    grep -v 'is owned by npm 6.14.8-1'
> 
> shows two files in some sort of ./.bin/ directory
> ----
> error: No package owns /usr/lib/node_modules/npm/node_modules/.bin/node-gyp
> error: No package owns /usr/lib/node_modules/npm/node_modules/.bin/semver
> ----
> 
> and then a number in a small number of npm packages, namely in
> - meant (the .github subdirectory)
> - minimist (the whole directory, i think)
> - node-gyp (the whole directory)
> - semver (the whole directory)
> that are also in the "No package owns" state.
> 
> note that [pacman -Syu] only complains about meant and minimist, not
> node-gyp or semver.
> 
> first off, i wonder if anyone has ideas of how i ended up in this
> situation?  i know that occasionally npm will exclaim, with enthusiasm,
> that a new, updated version, is available, and offer me a chance to
> update it.  normally i don't run as root.  but, if i had, in the past,
> sudo'd npm, and let it update itself, might *that* have produced this?
> 
> then, second, i'm ignorant enough to not be sure what to do and am
> looking for advice.  i can do [pacman --overwrite].  i could, i suppose
> (at what consequence?:) [pacman -R npm], then re-install.  (though i
> assume i'd have the same problem, as pacman would presumably leave
> untouched the files not owned by npm.)  i could just delete the
> offending files pacman complains about (meant/.github/..., and
> minimist/...).
> 
> okay, thanks in advance for any thoughts.
> 
> cheers, Greg


More information about the arch-general mailing list