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

npm-link-better --copy does not handle npm prefix #4

Closed
bodograumann opened this issue Feb 14, 2019 · 6 comments
Closed

npm-link-better --copy does not handle npm prefix #4

bodograumann opened this issue Feb 14, 2019 · 6 comments

Comments

@bodograumann
Copy link

I have setup a prefix in my .npmrc:

prefix=/home/bodo/.local

When I then try to use npm-link-better --copy, it tries to access ~/.local/node_modules/package-name. Instead it should look in ~/.local/lib64/node_modules/package-name.

@laggingreflex
Copy link
Owner

Why lib64 isn't obvious to me, could you explain?

Also to me it seems like it should look in /home/bodo/.local if that's what you've set in your .npmrc, no? Although I'm not entirely sure what this setting does. I am however using the command npm config get prefix to get the prefix directory (in which npm seems to store global modules)

@bodograumann
Copy link
Author

I can only tell you what I see on my system. (Gentoo Linux with npm 6.4.1 and node v8.12.0)

By default npm get prefix returns /usr. Then npm install --global would try to install into /usr/lib64/node_modules. E.g. as unprivileged user I get

npm WARN checkPermissions Missing write access to /usr/lib64/node_modules

So when I set the prefix to ~/.local, npm will install into ~/.local/lib64/node_modules.

@laggingreflex
Copy link
Owner

laggingreflex commented Feb 15, 2019

Fixed using global-prefix. Try v0.4.1

@bodograumann
Copy link
Author

No, that did not fix the issue. Maybe you should use global-modules instead⁉

@laggingreflex
Copy link
Owner

Alright, good call. Try 0.4.2

@laggingreflex laggingreflex reopened this Feb 15, 2019
@bodograumann
Copy link
Author

Almost :-D. I had to create a symlink ~/.local/lib -> ~/.local/lib64 as a workaround. Cf. jonschlinkert/global-modules#11

Thank you for the quick work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants