我不经常使用节点,我要回到2年前完美运行的ionic2项目。我现在运行ionic serve
并收到以下错误:
MacBook-Pro:doorman dave$ ionic serve
> ng run app:serve --host=0.0.0.0 --port=8100
[ng] node[6131]: ../src/node_contextify.cc:627:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
[ng] 1: 0x10003a9d9 node::Abort() [/usr/local/bin/node]
[ng] 2: 0x100039a13 node::AddEnvironmentCleanupHook(v8::Isolate*, void (*)(void*), void*) [/usr/local/bin/node]
[ng] 3: 0x10005f205 node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
[ng] 4: 0x100226d47 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/usr/local/bin/node]
[ng] 5: 0x100225ff8 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]
[ng] 6: 0x1002259c0 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
[ng] 7: 0x346a5b0cfb7d
[ng] 8: 0x346a5b089e66
[ng] 9: 0x346a5b10a480
我已经搜索了几个小时,无论我做什么,我都无法ionic serve
上班。有什么想法吗?
更新 我在下面添加了版本信息
Ionic:
ionic (Ionic CLI) : 4.5.0
Ionic Framework : not installed
@angular-devkit/build-angular : not installed
@angular-devkit/schematics : not installed
@angular/cli : not installed
@ionic/angular-toolkit : not installed
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 6.4.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 7 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v11.0.0 (/usr/local/bin/node)
npm : 6.5.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
是否因为未安装离子框架而发生?我已经尝试安装它,但似乎没有任何改变ionic info
答案 0 :(得分:0)
请按照说明的here重新安装离子体:
$ sudo npm install -g cordova
$ sudo npm install -g ionic
然后在您的项目中使用:
$ sudo npm install
最后用
运行$ ionic serve