sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.5k stars 1.33k forks source link

[Unsupported] Install node-sass 4.14.1 on Node 15 #3026

Closed huijing closed 3 years ago

huijing commented 3 years ago

When I run npm install, the process never completes and keeps repeating with this log message:

  c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DLIBSASS_VERSION="3.5.5"' -I/Users/huijing/.node-gyp/15.2.0/include/node -I/Users/huijing/.node-gyp/15.2.0/src -I/Users/huijing/.node-gyp/15.2.0/deps/openssl/config -I/Users/huijing/.node-gyp/15.2.0/deps/openssl/openssl/include -I/Users/huijing/.node-gyp/15.2.0/deps/uv/include -I/Users/huijing/.node-gyp/15.2.0/deps/zlib -I/Users/huijing/.node-gyp/15.2.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/subset_map.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/subset_map.o ../src/libsass/src/subset_map.cpp
In file included from ../src/libsass/src/subset_map.cpp:2:
../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' of type 'const
      std::__1::basic_string<char>' creates a copy from type 'const
      std::__1::basic_string<char>' [-Wrange-loop-analysis]
        for (const auto numerator : numerators)
                        ^
../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const
      std::__1::basic_string<char> &' to prevent copying
        for (const auto numerator : numerators)
             ^~~~~~~~~~~~~~~~~~~~~~
                        &
../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' of type 'const
      std::__1::basic_string<char>' creates a copy from type 'const
      std::__1::basic_string<char>' [-Wrange-loop-analysis]
        for (const auto denominator : denominators)
                        ^
../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const
      std::__1::basic_string<char> &' to prevent copying
        for (const auto denominator : denominators)
             ^~~~~~~~~~~~~~~~~~~~~~~~
                        &
2 warnings generated.

Is this an issue with libsass?

nschonni commented 3 years ago

The 4.14.1 dependency of gulp-sass isn't supported on Node 15. Your outside dependency of node-sass v5 is, but because of the internal dependency it's falling back to a native build on an unsupported combo

agemakeswise commented 3 years ago

getting this aswell:

npm: 6.14.8 node: v14.15.1 node process:

{ node: '14.15.1', v8: '8.4.371.19-node.17', uv: '1.40.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.16.1', modules: '83', nghttp2: '1.41.0', napi: '7', llhttp: '2.1.3', openssl: '1.1.1g', cldr: '37.0', icu: '67.1', tz: '2020a', unicode: '13.0' }

Node Platform (node -p process.platform): darwin Node architecture (node -p process.arch): x64 node-sass version (node -p "require('node-sass').info"):

node-sass 4.13.1 (Wrapper) [JavaScript] libsass 3.5.4 (Sass Compiler) [C/C++]

npm node-sass versions (npm ls node-sass):

├── node-sass@4.13.1 └─┬ nuxt-scss-to-js@1.0.4 └─┬ scss-to-json@2.0.0 └── node-sass@4.13.1

pabloleone commented 3 years ago

Just in case anyone is having this issue with Ionic, the solutions that worked for me was upgrading the "@ionic/app-scripts": "3.2.4", to version 3.2.4 (latest)

You must update that version manually in your package.json, remove node_modules and package-lock.json before installing everything again.

Hope it helps.

hamidash commented 3 years ago

npm update solved this for me

sfaman commented 3 years ago

Just delete node_modules, package-lock.json, nodejs, and reinstall the latest nodejs. Then try npm install again.

malindawijekoon-usn commented 3 years ago

Delete node_modules, package-lock.json and run npm install

polyccon commented 3 years ago

I had this issue, downgraded node --version: v16 to v14 and the problem went away.

scarroll32 commented 3 years ago

Downgrading to node14 worked, following these instructions

moriaMaman commented 2 years ago

@nschonni Hi I have a similar issue.

Those are my npm node-sass versions: └─┬ gulp-sass@2.3.2 └── node-sass@3.13.1

And Im using node v10.16.1.

Do you know how can I upgrade this node-sass version to 5?

I already try to do this command $ npm install node-sass@5 but it just add a outside dependency of node-sas -

├─┬ gulp-sass@2.3.2 │ └── node-sass@3.13.1 └── node-sass@5.0.0

Please, I really appreciate your help. I'm trying to figure out this issue for more then a week, and maybe changing this node-sass dependency will finally help

ZhuoZhuoCrayon commented 2 years ago

Downgrading to node14 worked, following these instructions

thanks, it's work for me

I use nvm to swich my dev env to node14