gpt4 book ai didi

node.js - Ionic 5.4.16 无法在 Node 12.19.0 @ Ubuntu 20.04 上运行

转载 作者:行者123 更新时间:2023-12-04 18:48:46 24 4
gpt4 key购买 nike

我最初使用apt的nodejs包( Node 10)来运行 Ionic 5 应用程序,但看起来需要 Node 12 或 14。
所以我安装了node --channel=12/stable然后 ionic@5与 npm。
然后只需使用 ionic start有一个示例应用程序,但 ionic serve崩溃:

$ ionic serve --verbose
ionic:lib Terminal info: { ci: false, shell: '/bin/bash', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'serve' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +3ms
ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: '/home/courrier/Repos/test/test/ionic.config.json', errors: [], context: 'app', type: 'angular' } +0ms
ionic Context: { binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: '/usr/local/lib/node_modules/ionic', execPath: '/home/courrier/Repos/test/test', version: '5.4.16' } +0ms
[...]
ionic:lib:hooks Looking for ionic:serve:before npm script. +0ms
ionic:utils-network checking for open port on 0.0.0.0:8100 +0ms
ionic:utils-network checking for open port on 127.0.0.1:8100 +2ms
ionic:utils-network checking for open port on 192.168.1.92:8100 +1ms
ionic:utils-network checking for open port on fe80::f4f8:10cd:17fd:94d0:8100 +0ms
ionic:utils-network error while checking fe80::f4f8:10cd:17fd:94d0:8100: Error: listen EINVAL: invalid argument fe80::f4f8:10cd:17fd:94d0:8100 at Server.setupListenHandle [as _listen2] (net.js:1300:21) at listenInCluster (net.js:1365:12) at doListen (net.js:1502:7) at processTicksAndRejections (internal/process/task_queues.js:85:21) { code: 'EINVAL', errno: 'EINVAL', syscall: 'listen', address: 'fe80::f4f8:10cd:17fd:94d0', port: 8100 } +0ms
ionic:lib:serve Looking for ionic:serve npm script. +8ms
> ng run app:serve --host=localhost --port=8100 --verbose
ionic:lib:serve received unexpected close for ng (code: 127) +378ms

[ERROR] ng has unexpectedly closed (exit code 127).

The Ionic CLI will exit. Please check any output above for error details.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 1 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +11ms

Capacitor 也无法安装和添加 android 目标:
$ ionic cap add android --verbose
ionic:lib Terminal info: { ci: false, shell: '/bin/bash', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'cap', 'add', 'android' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +3ms
ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: '/home/courrier/Repos/test/test/ionic.config.json', errors: [], context: 'app', type: 'angular' } +0ms
ionic Context: { binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: '/usr/local/lib/node_modules/ionic', execPath: '/home/courrier/Repos/test/test', version: '5.4.16' } +0ms
> ionic integrations enable capacitor
> npm i --save -E @capacitor/core
ionic:lib:telemetry Sending telemetry for command: 'ionic integrations enable' [ 'capacitor', '--interactive', '--color' ] +0ms
[ERROR] An error occurred while running subprocess npm.

npm i --save -E @capacitor/core exited with exit code 243.

Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 1 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +10ms

最佳答案

尝试这个:

npm install @ionic/app-scripts@latest --save-dev
在项目目录的根目录中。

关于node.js - Ionic 5.4.16 无法在 Node 12.19.0 @ Ubuntu 20.04 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67895316/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com