gulp task issue with nodejs v10.3.0 : src\node_contextify.cc:629: Assertion `args[1]->IsString()' failed

Javascriptnode.jsGulpNode Modules

Javascript Problem Overview


I recently updated my nodejs version to 10.30.0. Everything works fine. But my gulp build task not working which was working fine on older version(9.X). This is what I am getting.

 gulp[11376]: src\node_contextify.cc:629: Assertion `args[1]->IsString()' failed.
 1: node::DecodeWrite
 2: node::DecodeWrite
 3: uv_loop_fork
 4: v8::internal::interpreter::BytecodeDecoder::Decode
 5: v8::internal::RegExpImpl::Exec
 6: v8::internal::RegExpImpl::Exec
 7: v8::internal::RegExpImpl::Exec
 8: 00000384E1284281

Somebody, please help me.

Javascript Solutions


Solution 1 - Javascript

Just run command

npm install natives

Solution 2 - Javascript

I have had two different solutions work in two different workspaces. The first after updating to node 10.6.0 required me to use this method:

$rm -rf node_modules
$rm -rf package-lock.json
$npm cache clean
$npm install

The second workspace wouldn't work with the above, though I did try it first, it required me to reinstall all my gulp dependencies then run npm audit fix. For example:

$npm install --dev gulp gulp-sass gulp-autoprefixer
$npm audit fix

Hope this helps someone.

Solution 3 - Javascript

node version compatible problem, try use node version<=9.11.2.

Solution 4 - Javascript

I had the same issue. Deleting node_modules and re-running npm install, to re-install the modules listed in package.json, did work for me.

Solution 5 - Javascript

Just run these two commands.

  1. remove node_modules folder

> rm -r node_modules

  1. And Install only natives dependencies.

> npm install natives

Solution 6 - Javascript

npm install natives

This works with Windows 10 64 Bit

Solution 7 - Javascript

My system:

  1. Windows 10
  2. Node 10.15.3

Steps:

  1. npm update
  2. npm i natives
  3. npm i
  4. npm audit fix

The order is required.

My packages after when I have updated via command "npm update":

{
  "name": "your name",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "autoprefixer": "^7.2.6",
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-plugin-async-to-promises": "^1.0.5",
    "babel-preset-es2015": "^6.24.1",
    "bootstrap": "v4.0.0-beta",
    "chartist-webpack": "^0.9.5-0",
    "d3": "^4.13.0",
    "d3.js": "^0.0.2-security",
    "datalist-polyfill": "^1.23.3",
    "dimple-js": "^2.1.4",
    "future-tabs": "^1.3.2",
    "gridstack": "0.2.6",
    "gulp": "^3.9.1",
    "gulp-cache-bust": "^1.4.0",
    "gulp-clean": "^0.3.2",
    "gulp-connect": "^5.7.0",
    "gulp-cssmin": "^0.2.0",
    "gulp-extname": "^0.2.2",
    "gulp-postcss": "^7.0.1",
    "gulp-rename": "^1.4.0",
    "gulp-sass": "^3.1.0",
    "gulp-sequence": "^0.4.6",
    "gulp-sourcemaps": "^2.6.5",
    "ionicons": "^3.0.0",
    "jquery": "^3.3.1",
    "jquery-ui": "^1.12.1",
    "jquery-ui-touch-punch": "^0.2.3",
    "lodash": "^4.17.11",
    "md5": "^2.2.1",
    "moment": "^2.24.0",
    "natives": "^1.1.6",
    "postcss-flexbugs-fixes": "^2.0.0",
    "promise-polyfill": "6.0.2",
    "semaphore-async-await": "^1.5.1",
    "url-search-params-polyfill": "^2.0.3",
    "vanilla-modal": "^1.6.5",
    "webpack": "^3.12.0",
    "webpack-stream": "^4.0.3",
    "whatwg-fetch": "^2.0.4"
  }
}

Solution 8 - Javascript

I was facing similar problem too with gulp

gulp build[30580]: c:\ws\src\node_contextify.cc:635: Assertion `args[1]->IsString()' failed. 1: 00007FF6F86BC6AA v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506

npm install natives solved the problem in windows 64

Solution 9 - Javascript

using node v10.16.0

npm install natives

npm audit fix

Solution 10 - Javascript

npm (not yarn) solution

  1. Update your npm packages
  2. npm rebuild // Install will likely work too?
  3. You'll likely get a new error about 'parallels'
  4. Follow this guide (not mine): https://timonweb.com/javascript/how-to-fix-referenceerror-primordials-is-not-defined-error/

Why? Gulp v3 + Node v12 are incompatible with each other. Don't try updating to Gulp v4 for the purpose of fixing this issue, as there are breaking changes (unless you wanna rewrite your code). Don't downgrade Node because it's not scalable and you may run into other issues. You'll have to upgrade eventually.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionM14View Question on Stackoverflow
Solution 1 - JavascriptnosensusView Answer on Stackoverflow
Solution 2 - JavascriptjasonflahertyView Answer on Stackoverflow
Solution 3 - Javascript邱凯翔View Answer on Stackoverflow
Solution 4 - JavascriptConstantineView Answer on Stackoverflow
Solution 5 - JavascriptGufran HasanView Answer on Stackoverflow
Solution 6 - JavascriptShaji JosephView Answer on Stackoverflow
Solution 7 - JavascriptriwexView Answer on Stackoverflow
Solution 8 - JavascriptkaleemView Answer on Stackoverflow
Solution 9 - Javascriptlucho20ptView Answer on Stackoverflow
Solution 10 - Javascriptdylanh724View Answer on Stackoverflow