6

I am running on Mac OS X. I've recently updated node and npm to the latest version, following these accepted answer steps Upgrade Node.js to the latest version on Mac OS . Node: v10.4.1 and npm: 6.1.0 And now when I run my Gulp file, I am getting this error:

gulp[2838]: ../src/node_contextify.cc:629:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
 1: node::Abort() [/usr/local/bin/node]
 2: node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*, node::async_context) [/usr/local/bin/node]
 3: node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
 4: v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/usr/local/bin/node]
 5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/bin/node]
 6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
 7: 0x211117841bd
 8: 0x2111178ee5d
 9: 0x2111180b2a0
10: 0x21111793429
11: 0x21111793429
12: 0x21111793429
Abort trap: 6

Does anyone know what is the issue here?

Nemus
  • 3,879
  • 12
  • 38
  • 57

3 Answers3

7

A complete artical about this: https://davidsekar.com/nodejs/upgrading-your-gulp-for-running-with-node-v10

resume:

gulp 3.x doesn't work with node 10.x

remove gulp

npm rm -g gulp

install gulp-cli (a gulp-cli package was introduced, check it here https://www.npmjs.com/package/gulp-cli)

npm i gulp-cli -g 

install gulp v4 locally in your project

npm i gulp@next --save-dev

Last thing you need to make changements to your gulpfile.js, syntax and features changed. So read the artical for that, it's simple and straight forward. Here it is again.

Mohamed Allal
  • 17,920
  • 5
  • 94
  • 97
6

Don't understand why but run npm i natives solved the problem for me.

Tính Ngô Quang
  • 4,400
  • 1
  • 33
  • 33
  • 1
    That's right. I had gulp -v `3.9.1` and npm -v `v11.12.0`, but running this command `npm i natives` fixed it for me. Thanks. – Neel Feb 02 '21 at 17:29
1

All I needed to do is to update my Gulp version also. Running npm rebuild node-sass fixed my issue

Nemus
  • 3,879
  • 12
  • 38
  • 57