-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
When git-validate is installed as a dependency of another package when running npm install as root, git-validate fails to install.
The specific error is:
fs.js:640
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/tmp/baz/openstreetmap/.git/hooks/pre-commit'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.writeFileSync (fs.js:1333:33)
at Object.exports.installHooks (/tmp/baz/openstreetmap/node_modules/git-validate/lib/utils.js:248:12)
at Object.<anonymous> (/tmp/baz/openstreetmap/node_modules/git-validate/bin/install.js:3:7)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
This does not happen if I run as a regular user, or if I directly git clone this repo and run npm install.
To reproduce this, you can run the following (as root):
git clone https://github.com/pelias/openstreetmap.git && cd openstreetmap && npm install
P.S. I noticed that /tmp/baz/openstreetmap/.git/hooks/pre-commit does not exist. If I touch it, I get a different error:
fs.js:809
return binding.rename(pathModule._makeLong(oldPath),
^
Error: EACCES: permission denied, rename '/tmp/baz/openstreetmap/.git/hooks/pre-commit' -> '/tmp/baz/openstreetmap/.git/hooks/pre-commit.backup'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at Object.exports.installHooks (/tmp/baz/openstreetmap/node_modules/git-validate/lib/utils.js:245:16)
at Object.<anonymous> (/tmp/baz/openstreetmap/node_modules/git-validate/bin/install.js:3:7)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
pelias-openstreetmap@0.0.0-semantic-release /tmp/baz/openstreetmap
Metadata
Metadata
Assignees
Labels
No labels