Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue with symlinked modules #3575

Closed
wants to merge 1 commit into from

3 participants

Aaron Bieber Tim Oxley Domenic Denicola
Aaron Bieber

This diff causes npm to skip chown'ing symlinked node modules as modules installed with npm -g that contain a "bin" entry in package.json should already have correct permissions.

Example:
sudo npm install -g node-gyp
cd /tmp
npm link node-gyp
npm ERR! Error: EPERM, chmod '/tmp/node_modules/node-gyp/bin/node-gyp.js'

Tim Oxley
Collaborator

@qbit I believe this has been fixed. This works just fine for me on npm@1.3.23:

npm install -g node-gyp
cd /tmp
touch package.json
npm link node-gyp
Tim Oxley
Collaborator
Tim Oxley
Collaborator

@qbit is this fixed for you?

Aaron Bieber

Looks to be! Thanks @timoxley

Domenic Denicola domenic closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 17, 2013
  1. Aaron Bieber
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 9 deletions.
  1. +15 −9 lib/build.js
24 lib/build.js
View
@@ -174,15 +174,21 @@ function linkBins (pkg, folder, parent, gtop, cb) {
if (er) return cb(er)
// bins should always be executable.
// XXX skip chmod on windows?
- fs.chmod(path.resolve(folder, pkg.bin[b]), npm.modes.exec, function (er) {
- if (er || !gtop) return cb(er)
- var dest = path.resolve(binRoot, b)
- , src = path.resolve(folder, pkg.bin[b])
- , out = npm.config.get("parseable")
- ? dest + "::" + src + ":BINFILE"
- : dest + " -> " + src
- console.log(out)
- cb()
+ fs.lstat(folder, function (er,stat) {
+ if (!stat.isSymbolicLink) {
+ fs.chmod(path.resolve(folder, pkg.bin[b]), npm.modes.exec, function (er) {
+ if (er || !gtop) return cb(er)
+ var dest = path.resolve(binRoot, b)
+ , src = path.resolve(folder, pkg.bin[b])
+ , out = npm.config.get("parseable")
+ ? dest + "::" + src + ":BINFILE"
+ : dest + " -> " + src
+ console.log(out)
+ cb()
+ })
+ } else {
+ cb()
+ }
})
})
}, cb)
Something went wrong with that request. Please try again.