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

Problem installing node-sass v7.0.1 on Node 14 #3386

Closed aditya23-pg closed 6 months ago

aditya23-pg commented 7 months ago

When I do npm ci for my FE project I get this log which keeps on repeating:

npm ci 
npm WARN prepare removing existing node_modules/ before installation

> node-sass@7.0.1 install /Users/aditya/Development/pg-finance-frontend/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v7.0.1/darwin-arm64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v7.0.1/darwin-arm64-83_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@7.0.1 postinstall /Users/aditya/Development/pg-finance-frontend/node_modules/node-sass
> node scripts/build.js

Building: /Users/aditya/.nodenv/versions/14.16.1/bin/node /Users/aditya/Development/pg-finance-frontend/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/Users/aditya/.nodenv/versions/14.16.1/bin/node',
gyp verb cli   '/Users/aditya/Development/pg-finance-frontend/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@8.4.1
gyp info using node@14.16.1 | darwin | arm64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - executable path is "/opt/homebrew/opt/python@3.11/bin/python3.11"
gyp verb find Python - executing "/opt/homebrew/opt/python@3.11/bin/python3.11" to get version
gyp verb find Python - version is "3.11.6"
gyp info find Python using Python version 3.11.6 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
gyp verb get node dir no --target version specified, falling back to host node version: 14.16.1
gyp verb command install [ '14.16.1' ]
gyp verb install input version string "14.16.1"
gyp verb install installing version: 14.16.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 14.16.1
gyp verb build dir attempting to create "build" dir: /Users/aditya/Development/pg-finance-frontend/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? Yes
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/aditya/Development/pg-finance-frontend/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/aditya/Development/pg-finance-frontend/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /Users/aditya/Development/pg-finance-frontend/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
gyp info spawn args [
gyp info spawn args   '/Users/aditya/Development/pg-finance-frontend/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aditya/Development/pg-finance-frontend/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aditya/Development/pg-finance-frontend/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/aditya/Library/Caches/node-gyp/14.16.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/aditya/Library/Caches/node-gyp/14.16.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/aditya/Development/pg-finance-frontend/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/aditya/Library/Caches/node-gyp/14.16.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/aditya/Development/pg-finance-frontend/node_modules/node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture arm64
gyp verb node dev dir /Users/aditya/Library/Caches/node-gyp/14.16.1
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  c++ -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp '-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/aditya/Library/Caches/node-gyp/14.16.1/include/node -I/Users/aditya/Library/Caches/node-gyp/14.16.1/src -I/Users/aditya/Library/Caches/node-gyp/14.16.1/deps/openssl/config -I/Users/aditya/Library/Caches/node-gyp/14.16.1/deps/openssl/openssl/include -I/Users/aditya/Library/Caches/node-gyp/14.16.1/deps/uv/include -I/Users/aditya/Library/Caches/node-gyp/14.16.1/deps/zlib -I/Users/aditya/Library/Caches/node-gyp/14.16.1/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -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/ast.o.d.raw   -c
In file included from ../src/libsass/src/ast.cpp:2:
../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'std::string const' [-Wrange-loop-construct]
        for (const auto numerator : numerators)
                        ^
../src/libsass/src/ast.hpp:1614:14: note: use reference type 'std::string const &' to prevent copying
        for (const auto numerator : numerators)
             ^~~~~~~~~~~~~~~~~~~~~~
                        &
../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'std::string const' [-Wrange-loop-construct]
        for (const auto denominator : denominators)
                        ^
../src/libsass/src/ast.hpp:1616:14: note: use reference type 'std::string const &' to prevent copying
        for (const auto denominator : denominators)
             ^~~~~~~~~~~~~~~~~~~~~~~~
                        &
saper commented 6 months ago

We don't provide pre-compiled binaries for arm so you have to compile it your self. How did the build finish?

aditya23-pg commented 6 months ago

@saper

  1. build finish means ? When I build the project building works fine.
  2. Pre-compiling please can you elaborate on this ?
saper commented 6 months ago
  1. I suspect gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] finished normally, just issuing some warnings? Can't see any compilation errors there.
  2. if you install node-sass for a supported platform (see https://github.com/sass/node-sass/releases) you are getting a ready-to-use binary module downloaded from GitHub for you. It does not work for you, since we do not provide those modules for arm. This is not a show-stopper though.