Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Post install failed #2178

Closed
ZaniaDeveloper opened this issue Dec 5, 2017 · 5 comments
Closed

Post install failed #2178

ZaniaDeveloper opened this issue Dec 5, 2017 · 5 comments

Comments

@ZaniaDeveloper
Copy link

ZaniaDeveloper commented Dec 5, 2017

  • NPM version (npm -v): 5.5.1
  • Node version (node -v): v6.11.4
  • Node Process (node -p process.versions):
{ http_parser: '2.7.0',
  node: '6.11.4',
  v8: '5.1.281.108',
  uv: '1.9.1',
  zlib: '1.2.11',
  ares: '1.13.0',
  icu: '57.1',
  modules: '48',
  openssl: '1.0.2g' }
  • Node Platform (node -p process.platform): linux
  • Node architecture (node -p process.arch): x64

When i want install, here is the result, with an infinite execution, the installation processus never ends :

image

And it's absolutely not a problem with access rights (permissions), indeed, the /usr/local/lib/node_modules/node-sass/vendor/linux-x64-48 directory can't be created cause the /usr/local/lib/node_modules/node-sass/vendor directory never exists in post-install.

@nschonni
Copy link
Contributor

nschonni commented Dec 6, 2017

It is an access issue from the EACCES message.
Duplicate of #1098

@nschonni nschonni closed this as completed Dec 6, 2017
@mvrhov
Copy link

mvrhov commented Dec 7, 2017

I'm also hitting this. And it cannot be access issue. as I'm running npm install as root. and I'm not installing this globally.
Latest LTS node with npm that comes with it.

@mvrhov
Copy link

mvrhov commented Dec 7, 2017

I had to run npm with: npm install --unsafe-perm=true

The problem is with node-sass because it tries to install some files globally!

npm install --unsafe-perm=true

> [email protected] install /srv/www/project/site/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-57_binding.node
Download complete..] - :
Binary saved to /srv/www/project/site/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /root/.npm/node-sass/4.7.2/linux-x64-57_binding.node

@tripstar22
Copy link

Had the same issue as @mvrhov and his solution worked for me

@ZaniaDeveloper
Copy link
Author

ZaniaDeveloper commented Dec 15, 2017

Hello @nschonni,

thank you for your answer, but read all the content of issue, please, it's absolutely not an EACCES, and #1098 can't resolve problem !

I said « /usr/local/lib/node_modules/node-sass/vendor/linux-x64-48 directory can't be created cause the /usr/local/lib/node_modules/node-sass/vendor directory », it's cause the vendor directory doesn't exist, the vendor directory is not created. If it can't be created cause an EACCES, so the solution is elsewhere i'm executed command in a root session (no need sudo).

Yes, it's an npm install -g command in a root terminal in a root session, root user has all permissions ! Am i wrong ? How to have an EACESS problem in a root session, i don't know. Yes i know it's only possible if we attempt to create a file or a directory inside another non-existent directory. But otherwise, it's impossible to have an EACESS in a root session, with an EUID = 0.

In #1098, @saper said « sudo npm will run our installations scripts as nobody », so i switched to root session by sudo su - but the same problem has always occured. Then i did a chown -R nobody $(npm config get prefix)/{lib/node_modules,bin,share}, but that's failed too.

Everybody say «check permissions, check permissions, ...», it's a joke ? We aren't novices, for information all is root, session, directories, etc., so: No problem with permissions !!

You know, if it's really a permission problem, it concerns the vendor directory in node-sass install. But how check permissions on the node-sass installation directory, this directory is created by npm install, how to check permission on a non-existent directory ?

Following @mvrhov 's advice, i did npm install --unsafe-perm=true -g node-sass and it works. #1098 solves nothing at all, but @mvrhov fixed up the problem.

But it may true, it can be a permission problem cause --unsafe-perm=true flag is a workaround of a permission problem, we can suppose it. But how ? All is ok, and just a flag solves that problem. I can say too that it's only a node-sass problem cause other npm install -g work (even with projects which use gyp). I can't see why it's a permission problem, seriously.

This problem is a big big big problem, cause node-sass is in dependencies of some other projects like "@angular/cli", and cause this problem "@angular/cli" can't be installed cause this big big problem.

Fortunately @mvrhov is here and now i can use "@angular/cli".

Plus, all is explained in TROUBLESHOOTING.md which gives the same solution given by @mvrhov, the solution solves the problem but i'm not convinced with explanations.

Thank you for closing the issue even if the problem has not been fixed yet. For the next time, asking if it is okay is the minimal politeness.

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

No branches or pull requests

4 participants