【问题标题】:Ionic is not working well on server CentOS 7.99 after correct installation正确安装后,Ionic 在服务器 CentOS 7.99 上无法正常运行
【发布时间】:2022-02-01 05:01:31
【问题描述】:

我感到很沮丧,因为我无法找到我正在寻找的方法。我想运行我安装了 node、npm、angular、ionic、Cordova 的离子服务器。 什么错误?

ionic start todo blank

系统问我要不要角度,我选择了角度,所以,系统开始运行命令,然后卡住了

npm i --save -E @capacitor/core@latest

它给我一个安装后脚本的错误,这是一个特定的:

> npm i
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, whichis known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, whichis known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /root/ion_test/todo/node_modules/@angular/cli
npm ERR! command failed
npm ERR! command sh -c node ./bin/postinstall/script.js
npm ERR! node:internal/modules/cjs/loader:936
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module '/root/ion_test/todo/node_modules/@angular/cli/bin/postinstall/script.js'
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR!     at node:internal/main/run_main_module:17:47 {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: []
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-01-28T17_51_13_147Z-debug.log
[ERROR] An error occurred while running subprocess npm.

        npm i exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

我需要帮助,服务器将在 7 天内启动它,我想知道如何解决这个错误并运行 ionic start 和 ionic serve 而没有错误。

【问题讨论】:

标签: node.js angular linux ionic-framework centos


【解决方案1】:

听起来您的 Angular 安装要么是无聊的要么是过时的,或者 Angular 版本和 Ionic 不匹配。试试npm install -g @angular/cli@latest 看看是否有帮助。如果没有,请发布您的 Angular 版本和 package.json。

【讨论】:

  • 您好,蒂姆,该解决方案对我不起作用。
  • ng v 的输出是什么?你的 package.json 是什么样的?如果您需要帮助,需要更多信息。请参阅minimum reproducible example 的指南。
  • for package.json 你指向 ionic 项目吗,我用 ionic start 创建了一个空白项目,它以 nom I 崩溃,因为我猜是 package.json ......另外,ng v 给出我这个输出: Angular CLI: 13.2.0 Node: 16.13.2 Package Manager: npm 8.1.2 OS: linux x64, Angular: undefined, @angular-devkit/architect 0.1302.0, @angular-devkit/core 13.2.0 , @angular-devkit/schematics 13.2.0, @angular/cli 13.2.0, @schematics/angular 13.2.0,
猜你喜欢
  • 1970-01-01
  • 2017-12-09
  • 1970-01-01
  • 2016-01-22
  • 2019-03-01
  • 2012-08-19
  • 2020-09-16
  • 2017-07-16
  • 1970-01-01
相关资源
最近更新 更多