You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The location that npm link tries to install symlinks into is inside of it's /nix installation directory which is unwritable, and thus fails. Specifically, when trying to link a package named foo, it tries to create a symlink at /nix/store/<nodejs-nix-package-hash>-nodejs-<nodejs-version>/lib/node_modules/foo.
It should try writing (and reading) to somewhere else that's actually allowed to be written to.
Steps to reproduce
Do npm link inside a node.js package.
If you don't have a local node.js package:
Install Node.js. (nix-env -iA nixpkgs.nodejs)
Create a directory, and cd into it.
npm init to create a package.json.
npm link
The text was updated successfully, but these errors were encountered:
Havvy
changed the title
npm link fails due to read-only fs
npm link fails due to read-only fs
Jun 23, 2016
It is possible to make a workaround for this by having a custom prefix inside ~/.npmrc. So if you create ~/.npmrc with content:
prefix=~/.npm
Next time your run npm link or npm install -g, it would use ~/.npm as root folder.
It would be nice to incorporate this inside nodejs nix expression so it could use some global writable folder by default. I would take a closer look if we could have this in nodejs expression.
Issue description
The location that
npm link
tries to install symlinks into is inside of it's/nix
installation directory which is unwritable, and thus fails. Specifically, when trying to link a package namedfoo
, it tries to create a symlink at/nix/store/<nodejs-nix-package-hash>-nodejs-<nodejs-version>/lib/node_modules/foo
.It should try writing (and reading) to somewhere else that's actually allowed to be written to.
Steps to reproduce
Do
npm link
inside a node.js package.If you don't have a local node.js package:
nix-env -iA nixpkgs.nodejs
)npm init
to create a package.json.npm link
The text was updated successfully, but these errors were encountered: