【问题标题】:Cannot install anything in Ionic because of Typescript由于 Typescript,无法在 Ionic 中安装任何东西
【发布时间】:2017-12-18 07:27:01
【问题描述】:

当我尝试在 Ionic 中安装任何东西时,我收到一个错误,提示我没有 Typescript,当我尝试安装它时,即使我正在尝试安装它,它也会给我同样的错误。

这是我的日志:

1108 warn tslint@5.5.0 requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || 

>=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev but none was 

installed.
1109 warn tsutils@2.6.1 requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || 

>=2.2.0-dev || >=2.3.0-dev || >= 2.4.0-dev || >= 2.5.0-dev || >= 2.6.0-dev but none 

was installed.
1110 verbose stack Error: ENOENT: no such file or directory, stat 'C:\Users\HH

\Documents\ionicproject\file:cordova-common-1.1.1.tgz'
1110 verbose stack     at Error (native)
1111 verbose cwd C:\Users\HH\Documents\ionicproject
1112 verbose Windows_NT 6.3.9600
1113 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\HH\\AppData\

\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "cordova-common@1.1.1"
1114 verbose node v6.10.2
1115 verbose npm  v5.2.0
1116 error path C:\Users\HH\Documents\ionicproject\file:cordova-common-1.1.1.tgz
1117 error code ENOENT
1118 error errno -4058
1119 error syscall stat
1120 error enoent ENOENT: no such file or directory, stat 'C:\Users\HH\Documents

\ionicproject\file:cordova-common-1.1.1.tgz'
1121 error enoent This is related to npm not being able to find a file.
1122 verbose exit [ -4058, true ]

【问题讨论】:

  • 你能显示你用来安装它们的 npm 命令吗?
  • 我试过运行npm install

标签: typescript ionic-framework npm


【解决方案1】:

首先卸载你当前的打字稿,

npm uninstall -g typescript

然后安装 tslint 和 typescript

 npm install -g tslint typescript

同时清除 npm 缓存。

【讨论】:

  • 当我尝试安装任何东西时,我仍然收到完全相同的错误
  • 您的错误来自您的打字稿版本。尝试清理缓存,运行 npm install 以获取所有依赖项,然后使用提供的代码。
  • 仍然给我同样的错误:(。首先我使用npm cache clean -f然后npm install
猜你喜欢
  • 2013-06-29
  • 2018-04-26
  • 2019-02-28
  • 2012-09-06
  • 2018-09-20
  • 1970-01-01
  • 2020-07-31
  • 2021-05-02
  • 2014-06-08
相关资源
最近更新 更多