将节点升级到v10.4.1后出现Gulp错误

问题描述 投票:3回答:3

我在Mac OS X上运行。我最近将节点和npm更新到最新版本,遵循这些接受的答案步骤Upgrade Node.js to the latest version on Mac OS。节点:v10.4.1和npm:6.1.0现在当我运行我的Gulp文件时,我收到此错误:

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

有谁知道这里的问题是什么?

node.js gulp
3个回答
4
投票

关于此的完整文章:qazxsw poi

resume:

gulp 3.x不适用于节点10.x.

去掉gulp

https://davidsekar.com/nodejs/upgrading-your-gulp-for-running-with-node-v10

安装gulp-cli(引入gulp-cli包,在这里查看npm rm -g gulp

https://www.npmjs.com/package/gulp-cli

在项目中本地安装gulp v4

npm i gulp-cli -g 

您需要更改gulpfile.js,语法和功能的最后一件事。因此,阅读艺术,这是简单而直接的。 npm i gulp@next --save-dev


1
投票

我需要做的就是更新我的Gulp版本。运行Here it is again解决了我的问题


0
投票

不明白为什么,但运行npm rebuild node-sass解决了我的问题。

© www.soinside.com 2019 - 2024. All rights reserved.