我在MacOS X 10.13上安装了npm ionic cordova
sudo npm install -g cordova ionic
然后我跑了
ionic serve
并提示执行以下错误:
sudo chown -R $USER:$(id -gn $USER) /Users/admin/.config
我做了。
现在我无法运行ionic serve
:
$ ionic serve
> ionic-v1 serve --host=0.0.0.0 --port=8100 --livereload-port=35729 --dev-port=53703 --engine=browser
[v1] ionic-v1[12966]: ../src/node_contextify.cc:627:static void node::contextify::ContextifyScript::New(const FunctionCallbackInfo<v8::Value> &): Assertion `args[1]->IsString()' failed.
[v1] 1: 0x10003818c node::Abort() [/usr/local/bin/node]
[v1] 2: 0x100037367 node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, char const*, int, v8::Local<v8::Value>*, node::async_context) [/usr/local/bin/node]
[v1] 3: 0x10005c3de node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
[v1] 4: 0x1001f14e8 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/usr/local/bin/node]
[v1] 5: 0x1001f0811 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]
[v1] 6: 0x1001f0270 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
[v1] 7: 0x256b62bdc01d
[ERROR] A utility CLI has unexpectedly closed (exit code null).
The Ionic CLI will exit. Please check any output above for error
details.
$ npm i -D @ionic/v1-tookit
npm ERR! code E404
npm ERR! 404 Not Found: @ionic/v1-tookit@latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2018-09-06T11_18_15_262Z-debug.log
这是我的信息:
$ ionic info
[WARN] Bad integration name: gulp
✔ Gathering environment info - done!
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic1 1.3.4
@ionic/v1-toolkit : 1.0.8
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)
System:
NodeJS : v10.9.0 (/usr/local/Cellar/node/10.9.0/bin/node)
npm : 6.2.0
OS : macOS High Sierra
答案 0 :(得分:0)
我卸载了cordova,ionic和node,然后重新安装了它们,包括nvm。