Eli*_*l58 8 ionic-framework angular
我有一个有角度的项目,我想在移动设备上使用 ionic。我做到了ionic init。
当我运行命令时ionic serve,我收到此错误:
> ng.cmd run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
Run Code Online (Sandbox Code Playgroud)
这是我的package.json:
> ng.cmd run app:serve --host=localhost --port=8100
[ng] Error: Unknown arguments: host, port
[ERROR] ng has unexpectedly closed (exit code 1).
The Ionic CLI will exit. Please check any output above for error details.
Run Code Online (Sandbox Code Playgroud)
如何修复主机/端口缺少参数?
在SimpleDev发表评论后,我在这里尝试了所有答案:
npm install @ionic/app-scripts@latest --save-dev:该@ionic/app-scripts包已弃用,并且未更新为 Angular 14 或 15。运行它时,我得到Undefined variable standalone_static_library in binding.gyp while trying to load binding.gyp.node_modules并npm install:不改变任何内容小智 0
我希望这个解决方案可以帮助您:
npm 缓存清理 --force
npm 卸载 -g @angular/cli
npm 卸载 -g @ionic/cli
npm install -g @angular/cli
npm install -g @ionic/cli