sass / node-sass

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

node-sass 4.13 incompatible with latest node 12 version (Utf8Value) #2794

Closed jeandat closed 4 years ago

jeandat commented 4 years ago

Overview

Using latest version of node-sass with latest version of node 12 fail with this error:

/Users/jeandat/.node-gyp/12.13.0/include/node/v8.h:3046:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/jeandat/.node-gyp/12.13.0/include/node/v8.h:3039:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
1 error generated.

Full error log

Trace

Context

❯ npm -v
6.12.0

But I'm using yarn:
❯ yarn -v
1.19.2

❯ node -v
v12.13.0

❯ node -p process.versions
{
  node: '12.13.0',
  v8: '7.7.299.13-node.12',
  uv: '1.32.0',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.39.2',
  napi: '5',
  llhttp: '1.1.4',
  http_parser: '2.8.0',
  openssl: '1.1.1d',
  cldr: '35.1',
  icu: '64.2',
  tz: '2019a',
  unicode: '12.1'
}

❯ node -p process.platform
darwin

❯ node -p process.arch
x64

❯ node -p "require('node-sass').info"
node-sass       4.13.0  (Wrapper)       [JavaScript]
libsass         3.5.4   (Sass Compiler) [C/C++]

❯ npm ls node-sass
livesp-front@3.11.2 
├─┬ @angular-devkit/build-angular@0.13.0
│ └── UNMET OPTIONAL DEPENDENCY node-sass@4.11.0
└── node-sass@4.13.0 

❯ yarn list --pattern node-sass
yarn list v1.19.2
├─ @angular-devkit/build-angular@0.13.0
│  └─ node-sass@4.11.0
└─ node-sass@4.13.0
nschonni commented 4 years ago

We actually build and test with this combination in CI. It's likely that you're running into uses somewhere with the combination of Yarn and NVM handling native modules at all, rather than anything particularly with node-sass. the errro line is coming from core Node headers

jeandat commented 4 years ago

We actually build and test with this combination in CI

Are you testing with yarn too?

saper commented 4 years ago

It seem to me is that the compile error occurs in /Users/jeandat/Developer/jeandat/liveaction/project-eyelo-ng2/node_modules/@angular-devkit/build-angular/node_modules/node-sass/bui ld/config.gypi which contains node-sass 4.11 and not 4.13.

Y

jeandat commented 4 years ago

I'm going to migrate to angular 9 when it is released which will upgrade @angular-devkit/build-angular dependency. Thus if problem persist with angular 9 I will post an update. Thanks.

cclauss commented 4 years ago

What version of node-gyp is being used? The error log above says:

gyp info using node-gyp@3.8.0

Does upgrading to node-gyp@6.1.0 change things? https://github.com/nodejs/node-gyp/releases

jdbranham commented 4 years ago

What version of node-gyp is being used? The error log above says:

gyp info using node-gyp@3.8.0

Does upgrading to node-gyp@6.1.0 change things? https://github.com/nodejs/node-gyp/releases

Didn't help for me. But downgrading node to 10 did.