Node-sass: Post install failed

Created on 5 Dec 2017  路  5Comments  路  Source: sass/node-sass

  • 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.

Most helpful comment

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

All 5 comments

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

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.

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings