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

node-sass install caught in infinite loop #2006

Closed
tamzinblake opened this issue Jun 8, 2017 · 9 comments
Closed

node-sass install caught in infinite loop #2006

tamzinblake opened this issue Jun 8, 2017 · 9 comments

Comments

@tamzinblake
Copy link

This is in a Docker container using npm 5. I'm not sure how reproducible it is, but I thought it would be of interest anyway. It's possible that this happens because the temporary directory it's trying to use as a backup is the same as the install directory.

I can probably fix this by fixing my permissions, but an infinite loop seems undesirable.

  • NPM version (npm -v):
    5.0.3
  • Node version (node -v):
    6.9.5
  • Node Process (node -p process.versions):
    { http_parser: '2.7.0',
    node: '6.9.5',
    v8: '5.1.281.89',
    uv: '1.9.1',
    zlib: '1.2.8',
    ares: '1.10.1-DEV',
    icu: '57.1',
    modules: '48',
    openssl: '1.0.2k' }
  • Node Platform (node -p process.platform):
    linux
  • Node architecture (node -p process.arch):
    x64
  • node-sass version (node -p "require('node-sass').info"):
    node-sass 3.13.1 (Wrapper) [JavaScript]
    libsass 3.3.6 (Sass Compiler) [C/C++]
  • npm node-sass versions (npm ls node-sass):
└─┬ ember-cli-sass@5.6.0
  └─┬ broccoli-sass-source-maps@1.8.1
    └── node-sass@3.13.1

Log snippet:

19:53:38.709 gyp verb install --ensure was passed, so won't reinstall if already installed
19:53:38.709 gyp verb install version not already installed, continuing with install 6.9.5
19:53:38.709 gyp verb ensuring nodedir is created /usr/src/app/node_modules/node-sass/.node-gyp/6.9.5
19:53:38.709 gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/src/app/node_modules/node-sass/.node-gyp/6.9.5"
19:53:38.709 gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/src/app/node_modules/node-sass/.node-gyp"
19:53:38.709 gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
19:53:38.709 gyp verb command install [ '6.9.5' ]
19:53:38.709 gyp verb install input version string "6.9.5"
19:53:38.710 gyp verb install installing version: 6.9.5
19:53:38.710 gyp verb install --ensure was passed, so won't reinstall if already installed
19:53:38.710 gyp verb install version not already installed, continuing with install 6.9.5
19:53:38.710 gyp verb ensuring nodedir is created /usr/src/app/node_modules/node-sass/.node-gyp/6.9.5
19:53:38.710 gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/src/app/node_modules/node-sass/.node-gyp/6.9.5"
19:53:38.710 gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/src/app/node_modules/node-sass/.node-gyp"
19:53:38.710 gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
19:53:38.710 gyp verb command install [ '6.9.5' ]

(continues like that forever)

@saper
Copy link
Member

saper commented Jun 8, 2017

Probably interesting combination of a node-gyp issue (poor fallback on lack of permissions) and npm bug (infinite retry). npm 5 is hard to get working, does downgrade help?

@tamzinblake
Copy link
Author

Yeah, it only happens in npm 5. I think the infinite retry is likely node-gyp's issue. Solved the permissions issue by the tried-and-true method of npm install --unsafe-perm so I'm not actually seeing this anymore.

@tamzinblake
Copy link
Author

Probably the same as nodejs/node-gyp#115

cjreeder added a commit to byu-oit/av-scheduling-panel-deployment that referenced this issue Oct 19, 2017
@arodu
Copy link

arodu commented Nov 15, 2017

Same problem, I solved it like this

# npm -g --unsafe-perm install node-sass

thanks to @thomblake

@rey-fox
Copy link

rey-fox commented Nov 29, 2017

same problem also on npm 5.5.1 either still solved with:

# npm -g --unsafe-perm install node-sass

node-sass 4.7.2 (Wrapper) [JavaScript]
libsass 3.5.0.beta.2 (Sass Compiler) [C/C++]

@nschonni
Copy link
Contributor

Closing as this only appears to be an issue that happens when installing as root as documented by NPM https://docs.npmjs.com/misc/config#unsafe-perm
Running as root unsets this flag, but that permission is required for install scripts

@theferrit32
Copy link

This doesn't seem resolved. Installing node-sass globally fails when not run as root, and loops infinitely when run as root.

Is the expectation that node-sass must not be installed globally, or the user must pass --unsafe-perm when installing globally?

@xzyfer
Copy link
Contributor

xzyfer commented Mar 21, 2018 via email

xzyfer added a commit that referenced this issue Apr 16, 2018
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
nschonni pushed a commit to nschonni/node-sass that referenced this issue Jul 9, 2018
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See sass#2184
See sass#2006
See sass#1933
See sass#1925
See sass#1867
See sass#1845
xzyfer added a commit that referenced this issue Jul 16, 2018
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
xzyfer added a commit that referenced this issue Jul 16, 2018
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
xzyfer added a commit that referenced this issue Nov 7, 2019
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
xzyfer added a commit that referenced this issue Nov 7, 2019
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
xzyfer added a commit that referenced this issue Nov 7, 2019
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
xzyfer added a commit that referenced this issue Nov 8, 2019
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
xzyfer added a commit that referenced this issue Mar 21, 2020
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See #2184
See #2006
See #1933
See #1925
See #1867
See #1845
saper pushed a commit to saper/node-sass that referenced this issue May 17, 2020
This was a non-standared feature in LibSass we had to support. It
is being removed in LibSass 3.6.0.

This prevents people from output their source directory.

See sass/libsass#2611
See sass#2184
See sass#2006
See sass#1933
See sass#1925
See sass#1867
See sass#1845
@93lucasp
Copy link

You can try to change your node version with the recommended LTS. with nvm

On my mac I did this:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash

nvm install node

nvm install --lts

nvm use --lts

It fixed my problem without changing npm permission ;)

jiongle1 pushed a commit to scantist-ossops-m2/node-sass that referenced this issue Apr 7, 2024
LibSass fully parses selectors during the parsing stage. This is
different from Ruby Sass which parse selectors and string during
the parsing stage, and lazily eval'ing when required. This
difference causes some pathological selector issues. Our eager
parsing of selectors has resulted in us hacking in fake
`Parent_Selector` into `Sequence_Selector` during parsing.

These fake `Parent_Selector` play havoc with `resolve_parent_refs`
when within `@at-root` blocks. I spent a couple weeks going down
the rabbit whole of refactoring our selector parsing to be lazy before
bailing.

Explicitly marking which `Parent_Selector` are fake during parsing
allows us faithfully implement the `implicit_parent` flag in
`resolve_parent_refs`.

Fixes sass#2006
Fixes sass#2198
Spec sass/sass-spec#936
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants