Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-sass build failure in 7.x #16638

Closed
ocket8888 opened this issue Jan 10, 2020 · 2 comments
Closed

node-sass build failure in 7.x #16638

ocket8888 opened this issue Jan 10, 2020 · 2 comments

Comments

@ocket8888
Copy link

@ocket8888 ocket8888 commented Jan 10, 2020

馃悶 Bug report

Command

  • update
  • install

Is this a regression?

Yes, I believe this has been fixed before in 7.0 and even 7.1 as new versions of node-sass continually shatter as the packages hit the floor.

Description

both @angular/core@7.2.16 and @angular/core@7.1.4 fail to build its node-sass dependency when I try to ng update from 7.1.4 - or just try to npm install that version. The problem seems to be the versioning compatibility with my node version (13.5.0) and/or node-gyp version (6.0.1). It seems to be trying to install node-sass version 4.11.0, which fails.

I've confirmed that I can manually build node-sass version 4.12.x, so recommend switching to at least that version.

馃敩 Minimal Reproduction

  1. Have node version 13.5.0 and node-gyp 6.0.1
  2. npm install --global @angular/cli@7

馃敟 Exception or Error

g++ command and errors/output
g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node -I/home/MY_HOME_DIR/.node-gyp/13.5.0/src -I/home/MY_HOME_DIR/.node-gyp/13.5.0/deps/openssl/config -I/home/MY_HOME_DIR/.node-gyp/13.5.0/deps/openssl/openssl/include -I/home/MY_HOME_DIR/.node-gyp/13.5.0/deps/uv/include -I/home/MY_HOME_DIR/.node-gyp/13.5.0/deps/zlib -I/home/MY_HOME_DIR/.node-gyp/13.5.0/deps/v8/include -I../../../../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
In file included from ../../../../../nan/nan_converters.h:67,
                 from ../../../../../nan/nan.h:222,
                 from ../src/binding.cpp:1:
../../../../../nan/nan_converters_43_inl.h: In static member function 鈥榮tatic Nan::imp::ToFactoryBase::return_t Nan::imp::ToFactory::convert(v8::Local)鈥:
../../../../../nan/nan_converters_43_inl.h:18:49: error: cannot convert 鈥榲8::Local鈥 to 鈥榲8::Isolate*鈥
   18 |       val->To ## TYPE(isolate->GetCurrentContext())                            \
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                 |
      |                                                 v8::Local
../../../../../nan/nan_converters_43_inl.h:22:1: note: in expansion of macro 鈥榅鈥
   22 | X(Boolean)
      | ^
In file included from /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node.h:63,
                 from ../../../../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h:2762:37: note:   initializing argument 1 of 鈥榲8::Local v8::Value::ToBoolean(v8::Isolate*) const鈥
 2762 |   Local ToBoolean(Isolate* isolate) const;
      |                            ~~~~~~~~~^~~~~~~
In file included from ../../../../../nan/nan_converters.h:67,
                 from ../../../../../nan/nan.h:222,
                 from ../src/binding.cpp:1:
../../../../../nan/nan_converters_43_inl.h: In static member function 鈥榮tatic Nan::imp::ValueFactoryBase::return_t Nan::imp::ToFactory::convert(v8::Local)鈥:
../../../../../nan/nan_converters_43_inl.h:37:55: error: cannot convert 鈥榲8::Local鈥 to 鈥榲8::Isolate*鈥
   37 |   return val->NAME ## Value(isolate->GetCurrentContext());                     \
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                       |
      |                                                       v8::Local
../../../../../nan/nan_converters_43_inl.h:40:1: note: in expansion of macro 鈥榅鈥
   40 | X(bool, Boolean)
      | ^
In file included from /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node.h:63,
                 from ../../../../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h:2771:30: note:   initializing argument 1 of 鈥榖ool v8::Value::BooleanValue(v8::Isolate*) const鈥
 2771 |   bool BooleanValue(Isolate* isolate) const;
      |                     ~~~~~~~~~^~~~~~~
In file included from ../../../../../nan/nan_new.h:189,
                 from ../../../../../nan/nan.h:223,
                 from ../src/binding.cpp:1:
../../../../../nan/nan_implementation_12_inl.h: In static member function 鈥榮tatic Nan::imp::FactoryBase::return_t Nan::imp::Factory::New(v8::Local)鈥:
../../../../../nan/nan_implementation_12_inl.h:356:37: error: no matching function for call to 鈥榲8::StringObject::New(v8::Local&)鈥
  356 |   return v8::StringObject::New(value).As();
      |                                     ^
In file included from /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node.h:63,
                 from ../../../../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h:5688:23: note: candidate: 鈥榮tatic v8::Local v8::StringObject::New(v8::Isolate*, v8::Local)鈥
 5688 |   static Local New(Isolate* isolate, Local value);
      |                       ^~~
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h:5688:23: note:   candidate expects 2 arguments, 1 provided
In file included from ../../../../../nan/nan_new.h:189,
                 from ../../../../../nan/nan.h:223,
                 from ../src/binding.cpp:1:
../../../../../nan/nan_implementation_12_inl.h:356:58: error: expected primary-expression before 鈥>鈥 token
  356 |   return v8::StringObject::New(value).As();
      |                                                          ^
../../../../../nan/nan_implementation_12_inl.h:356:60: error: expected primary-expression before 鈥)鈥 token
  356 |   return v8::StringObject::New(value).As();
      |                                                            ^
In file included from ../src/binding.cpp:1:
../../../../../nan/nan.h: In function 鈥榲oid Nan::AsyncQueueWorker(Nan::AsyncWorker*)鈥:
../../../../../nan/nan.h:2232:62: warning: cast between incompatible function types from 鈥榲oid (*)(uv_work_t*)鈥 {aka 鈥榲oid (*)(uv_work_s*)鈥檥 to 鈥榰v_after_work_cb鈥 {aka 鈥榲oid (*)(uv_work_s*, int)鈥檥 [-Wcast-function-type]
 2232 |     , reinterpret_cast(AsyncExecuteComplete)
      |                                                              ^
In file included from /usr/include/c++/9.2.0/cassert:44,
                 from /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node_object_wrap.h:26,
                 from ../../../../../nan/nan.h:55,
                 from ../src/binding.cpp:1:
../../../../../nan/nan_object_wrap.h: In destructor 鈥榲irtual Nan::ObjectWrap::~ObjectWrap()鈥:
../../../../../nan/nan_object_wrap.h:24:25: error: 鈥榗lass Nan::Persistent鈥 has no member named 鈥業sNearDeath鈥
   24 |     assert(persistent().IsNearDeath());
      |                         ^~~~~~~~~~~
../../../../../nan/nan_object_wrap.h: In static member function 鈥榮tatic void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo&)鈥:
../../../../../nan/nan_object_wrap.h:127:26: error: 鈥榗lass Nan::Persistent鈥 has no member named 鈥業sNearDeath鈥
  127 |     assert(wrap->handle_.IsNearDeath());
      |                          ^~~~~~~~~~~
../src/binding.cpp: In function 鈥楴an::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)鈥:
../src/binding.cpp:284:98: warning: cast between incompatible function types from 鈥榲oid (*)(uv_work_t*)鈥 {aka 鈥榲oid (*)(uv_work_s*)鈥檥 to 鈥榰v_after_work_cb鈥 {aka 鈥榲oid (*)(uv_work_s*, int)鈥檥 [-Wcast-function-type]
  284 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                                  ^~~~~~~~~~~~
../src/binding.cpp: In function 鈥楴an::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)鈥:
../src/binding.cpp:320:98: warning: cast between incompatible function types from 鈥榲oid (*)(uv_work_t*)鈥 {aka 鈥榲oid (*)(uv_work_s*)鈥檥 to 鈥榰v_after_work_cb鈥 {aka 鈥榲oid (*)(uv_work_s*, int)鈥檥 [-Wcast-function-type]
  320 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                                  ^~~~~~~~~~~~
In file included from ../../../../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
../src/binding.cpp: At global scope:
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node.h:611:43: warning: cast between incompatible function types from 鈥榲oid (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)鈥 {aka 鈥榲oid (*)(v8::Local)鈥檥 to 鈥榥ode::addon_register_func鈥 {aka 鈥榲oid (*)(v8::Local, v8::Local, void*)鈥檥 [-Wcast-function-type]
  611 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node.h:645:3: note: in expansion of macro 鈥楴ODE_MODULE_X鈥
  645 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cpp:358:1: note: in expansion of macro 鈥楴ODE_MODULE鈥
  358 | NODE_MODULE(binding, RegisterModule);
      | ^~~~~~~~~~~
In file included from /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node.h:63,
                 from ../../../../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h: In instantiation of 鈥榲oid v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void (*)(const v8::WeakCallbackInfo&)]鈥: /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/node_object_wrap.h:84:78: required from here /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h:10400:16: warning: cast between incompatible function types from 鈥榲8::WeakCallbackInfo::Callback鈥 {aka 鈥榲oid (*)(const v8::WeakCallbackInfo&)鈥檥 to 鈥楥allback鈥 {aka 鈥榲oid (*)(const v8::WeakCallbackInfo&)鈥檥 [-Wcast-function-type] 10400 | reinterpret_cast(callback), type); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h: In instantiation of 鈥榲oid v8::PersistentBase::SetWeak(P*, typename v8::WeakCallbackInfo

::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo

::Callback = void (*)(const v8::WeakCallbackInfo&)]鈥: ../../../../../nan/nan_object_wrap.h:66:61: required from here /home/MY_HOME_DIR/.node-gyp/13.5.0/include/node/v8.h:10400:16: warning: cast between incompatible function types from 鈥榲8::WeakCallbackInfo::Callback鈥 {aka 鈥榲oid (*)(const v8::WeakCallbackInfo&)鈥檥 to 鈥楥allback鈥 {aka 鈥榲oid (*)(const v8::WeakCallbackInfo&)鈥檥 [-Wcast-function-type] make: *** [binding.target.mk:125: Release/obj.target/binding/src/binding.o] Error 1 make: Leaving directory '/home/MY_HOME_DIR/path/to/my/project/node_modules/@angular-devkit/build-angular/node_modules/node-sass/build'

馃實 Your Environment


    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / 鈻 \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 7.1.4
Node: 13.5.0
OS: linux x64
Angular: 7.2.16
... core

Package                             Version
-------------------------------------------------------------
@angular-devkit/architect           0.11.4
@angular-devkit/build-angular       0.13.6
@angular-devkit/build-optimizer     0.13.6
@angular-devkit/build-webpack       0.13.6
@angular-devkit/core                7.1.4
@angular-devkit/schematics          7.1.4
@angular/animations                 8.2.14
@angular/cli                        7.1.4
@angular/common                     8.2.14
@angular/compiler                   8.2.14
@angular/compiler-cli               8.2.14
@angular/forms                      8.2.14
@angular/http                       7.1.4
@angular/language-service           8.2.14
@angular/platform-browser           8.2.14
@angular/platform-browser-dynamic   8.2.14
@angular/platform-server            8.2.14
@angular/router                     8.2.14
@ngtools/webpack                    7.3.6
@schematics/angular                 7.1.4
@schematics/update                  0.11.4
rxjs                                6.5.4
typescript                          3.5.3
webpack                             4.29.0

^ this was run after I failed to update from 7.1.4 to 7.2.16 ^

Anything else relevant?
OS is Manjaro - up-to-date
npm version 6.13.4

@ocket8888 ocket8888 changed the title node-sass build failure in 7.2.16 node-sass build failure in 7.x Jan 10, 2020
@clydin

This comment has been minimized.

Copy link
Member

@clydin clydin commented Jan 11, 2020

Angular 7.x is currently under long-term support (LTS) and only receives critical fixes (essentially security fixes). It also does not officially support Node.js 13. Please consider updating to 8.x. Version 8.x also no longer uses node-sass by default and will avoid the native compilation issue.
For information regarding an update from 7.x to 8.x, please see: https://update.angular.io

@clydin clydin closed this Jan 11, 2020
@ocket8888

This comment has been minimized.

Copy link
Author

@ocket8888 ocket8888 commented Jan 11, 2020

I have the same issue with ng update --to @angular/core@8.

Where can I find information on which versions of angular support which versions of Node?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can鈥檛 perform that action at this time.