ionic 2项目中ionic服务器返回错误

j2qf4p5b  于 2022-12-08  发布在  Ionic
关注(0)|答案(1)|浏览(175)

我不太经常使用node,我将回到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的结果

zxlwwiss

zxlwwiss1#

请重新安装离子像here解释:

$ sudo npm install -g cordova
$ sudo npm install -g ionic

然后在项目中用途:

$ sudo npm install

最后运行

$ ionic serve

相关问题