gulp: Native crash in Node 10
I installed Node 10 on MacOS and Win 10. Used it for various node things with no issues. But starting gulp always results in a native crash. Smells like a Node bug but I report it here because I haven’t seen it anywhere else.
Same steps for Mac or Win…
- Have empty gulpfile.js
- Run
gulp
- See crash output:
$ gulp
[21:08:45] Using gulpfile ~/code/gulptest/gulpfile.js
gulp[62193]: ../src/node_contextify.cc:631:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
1: node::Abort() [/Users/roblou/.nvm/versions/node/v10.0.0/bin/node]
2: node::InternalCallbackScope::~InternalCallbackScope() [/Users/roblou/.nvm/versions/node/v10.0.0/bin/node]
3: node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/roblou/.nvm/versions/node/v10.0.0/bin/node]
4: v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/Users/roblou/.nvm/versions/node/v10.0.0/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) [/Users/roblou/.nvm/versions/node/v10.0.0/bin/node]
6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/roblou/.nvm/versions/node/v10.0.0/bin/node]
7: 0x2ee39308427d
[1] 62193 abort gulp
Same result if I run ./node_modules/.bin/gulp
What version of gulp are you using? What versions of npm and node are you using?
$ gulp -v [21:10:31] CLI version 3.9.1 [21:10:31] Local version 3.9.1 $ node -v v10.0.0
If you can’t reproduce this, I’m happy to debug more, but since I see it in 2 different environments, hopefully it’s easy to reproduce.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 52
- Comments: 31 (10 by maintainers)
Links to this issue
- javascript - gulp task issue with nodejs v10.3.0 : src\node_contextify.cc:629: Assertion `args[1]->IsString()' failed - Stack Overflow
- Update to NW.js v0.46.0 to fix GitLab sign in (!217) · Merge requests · gitter / desktop · GitLab
- Update to NW.js v0.46.0 to fix GitLab sign in (!217) · Merge requests · gitter / desktop · GitLab
Commits related to this issue
- chore(deps): update deprecated deps for node 10 (#5763) **Summary** These are a few upgrades of dependencies in order to address issues on node 10 (in relation to: https://github.com/yarnpkg/yarn/is... — committed to yarnpkg/yarn by imsnif 6 years ago
- remove "node" (which resolves to 10) from travis It seems we need gulp 4 for it https://github.com/gulpjs/gulp/issues/2162 — committed to tepez/jasmine-misc-matchers by tomyam1 6 years ago
- upgrade gulp for node 10 See [this gulp issue](https://github.com/gulpjs/gulp/issues/2162) — committed to trescenzi/shadycss by trescenzi 6 years ago
- chore(build): Fix build in Node 10 by updating yarn.lock (#32) [Build was breaking](https://travis-ci.org/eventbrite/eventbrite-sdk-javascript/builds/374217527) on `'node'` version in Travis because ... — committed to eventbrite/eventbrite-sdk-javascript by benmvp 6 years ago
- Fix build in node 10 Building the project and running tests in node 10 led to the following error: ``` $ npm test > @ test /Users/rzueger/Development/odch/flightbox > gulp test gulp[18899]: ../src... — committed to odch/flightbox by rzueger 6 years ago
- Fix build in node 10 Building the project and running tests in node 10 led to the following error: ``` $ npm test > @ test /Users/rzueger/Development/odch/flightbox > gulp test gulp[18899]: ../src... — committed to odch/flightbox by rzueger 6 years ago
- Fix build in node 10 Building the project and running tests in node 10 led to the following error: ``` $ npm test > @ test /Users/rzueger/Development/odch/flightbox > gulp test gulp[18899]: ../src... — committed to odch/flightbox by rzueger 6 years ago
- fixed gulp issue described on gulpjs/gulp#2162 https://github.com/gulpjs/gulp/issues/2162 — committed to CarbonCollins/civocloud-nodejs by CarbonCollins 6 years ago
- Fix https://github.com/gulpjs/gulp/issues/2162 — committed to ciffelia/ciffelia.com by ciffelia 6 years ago
Same issue with the console output.
Solution is delete node_modules dir and package-lock.json. Then run
sudo npm install --unsafe-perm=true
Thanks the information from @roblourens @MichaReiser @phated @tdmalone .@phated Got it - thank you! I did indeed get confused.
For others coming across this, here’s what you need to do for Node 10 support (if using Yarn):
natives@^1.1.0
in your lock filenatives@^1.1.3
yarn
If using npm with a package-lock.json the process will probably be fairly similar.
(Be careful modifying your lock file. There’s probably a better way to do it!)
Same error for:
Solution:
See @Carlos7646 and Alberto answers for details.
Thanks.
I’m facing the same issue using Windows 10 and Node 10. Deleted all node_modules folder after upgrading and ran npm rebuild.
You can also add this to your package.json:
clearest workaround so far. worked for me (win10, node10)
I stopped understanding how npm works at some point, I don’t know why I wasn’t already getting the latest, but yeah forcing
natives
to 1.1.3 is the right workaround…I wouldn’t recommend deleting your entire lock file, unless you’re sure that you want to upgrade everything. It’s probably better just to upgrade the exact package that is causing the issue (which is
natives
).@Carlos7646 this solution worked me too, thanks man!
If you are using yarn you can try the following:
Use
yarn why natives
to identify the packages using the natives module. Uninstall these packages withyarn remove
and install them againyarn add
. In my case it was thegulp-less-watcher
plugin.@roblourens there’s a patch version of
natives
that needs to be updated. Check out what their latest version is and compare against your lockfile.@fishcharlie news to me:
I was experiencing this issue as well with gulp v3.9.1. Switching to Node v9.0 solved it for me.