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

scripts/install.js tries to traverse filesystem tree; breaks if access not possible #2157

@criess

Description

@criess

I try to install node-sass 4.7.1 in the following environment:

npm install in (any) local user folder.
npm 3.10.10
node v6.11.5

I can confirm this an 4.7 Bug, as 4.6.x installs just fine.

npm install node-sass@"~4.6.0" runs fine.
npm install node-sass@"~4.7.0" breaks stuff.

Somehow the installer script tries to traverse any parents of the current install location. I don't know why it does so. This breaks in my case where the traversing hits the vhost level of my hosting config (/var/www/vhosts/myfancyvhost.com)

npm WARN prefer global [email protected] should be installed with -g

> [email protected] install /var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/node-sass
> node scripts/install.js

/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:321
        throw er
        ^

Error: EACCES: permission denied, scandir '/var/www/vhosts/myfancyvhost.com'
    at Error (native)
    at Object.fs.readdirSync (fs.js:953:18)
    at GlobSync._readdir (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:275:41)
    at GlobSync._processReaddir (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:135:22)
    at GlobSync._process (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:130:10)
    at GlobSync._processReaddir (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:205:10)
    at GlobSync._process (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:130:10)
    at GlobSync._processReaddir (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:205:10)
    at GlobSync._process (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:130:10)
    at GlobSync._processReaddir (/var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/node_modules/true-case-path/node_modules/glob/sync.js:205:10)
npm WARN [email protected] No repository field.
npm ERR! Linux 3.10.0-042stab124.2
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "node-sass@~4.7.0"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node scripts/install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/vhosts/myfancyvhost.com/antrag/shared/bundle/ruby/2.4.0/bundler/gems/entwicklung.frontend-oa-75ea994727c8/npm-debug.log

maybe this error is coming from a library node-sass install scripts rely on. But I can't really tell.

This is my first bug report, please contact me if you need more information.

As a workaround I set the version to node-sass@~4.6.0 (works fine).

mfg CR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions