Skip to content

Installation and linking with npm fails if folder is not owned by root on Linux #4

@mattheworiordan

Description

@mattheworiordan

Hi there

When I run the command sudo npm link your NPM is failing. However, when I run locally it works, but when I run on my Ubuntu server where there are non-standard permissions set on the application folder, the install fails. I have tried setting up the repository in the ubuntu home folder, and then running sudo npm link and it works fine, but when I put the repository in /var/[my app]/ and set permissions on those folders to allow a specific user and group, it no longer works.

Do you have any idea what may be causing this?

Thanks for your help
Matt

Here is the output

npm http GET https://registry.npmjs.org/murmurhash3
npm http GET https://registry.npmjs.org/ws
npm http 304 https://registry.npmjs.org/murmurhash3
npm http 304 https://registry.npmjs.org/ws

> murmurhash3@0.1.1 install /var/my-app/core/node_modules/murmurhash3
> node-gyp rebuild

npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
gyp ERR! rebuild error Error: EACCES, mkdir '/var/my-app/core/node_modules/murmurhash3/build'
gyp ERR! not ok 
npm ERR! murmurhash3@0.1.1 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the murmurhash3@0.1.1 install script.
npm ERR! This is most likely a problem with the murmurhash3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls murmurhash3
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-30-generic
npm ERR! command "node" "/usr/local/bin/npm" "link"
npm ERR! cwd /var/my-app/core
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! code ELIFECYCLE
npm ERR! message murmurhash3@0.1.1 install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/options

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions