无法在注册表中找到“dt〜mocha”(“npm”)

无法在注册表中找到“dt〜mocha”(“npm”)

问题描述:

我正尝试在当前的打字稿项目中设置摩卡和chai。无法在注册表中找到“dt〜mocha”(“npm”)

我要通过页面下方来实现相同的: -

https://journal.artfuldev.com/write-tests-for-typescript-projects-with-mocha-and-chai-in-typescript-86e053bdb2b6

$ typings install dt~mocha --global --save 

在Ubuntu上面的命令运行时,我收到错误: -


typings ERR! message Unable to find "dt~mocha" ("npm") in the registry. Did you want to try searching another source? Also, if you want to contribute these typings, please help us: https://github.com/typings/registry 
typings ERR! caused by https://api.typings.org/entries/npm/dt~mocha/versions/latest responded with 404, expected it to equal 200 

typings ERR! cwd /home/abhishek/Desktop/TypeScript/automation/jasmine 
typings ERR! system Linux 3.19.0-47-generic 
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install" "dt~mocha" "--global" "--save" 
typings ERR! node -v v7.7.3 
typings ERR! typings -v 0.8.1 

typings ERR! If you need help, you may report this error at: 
typings ERR! <https://github.com/typings/typings/issues> 

I尝试搜索互联网。另外,我尝试了几件事,但它失败了。

关于此问题的任何想法如何解决我的问题?

我通过页面和,而不是下面的命令运行去: -

$ typings install dt~mocha --global --save 
 
$ typings install npm~chai --save

我看到有您共享的页面,你可以使用命令: -

现在有另一种方法来添加TypeScript 2.0中的类型定义,所以我们也可以使用它来代替上面提到的类型定义方法。该方法不依赖于类型npm包或模块。为了充分利用这一点,键入以下命令:

$ npm install @types/chai @types/mocha --save-dev

我跟着步骤的休息和它的工作!

我知道这可能不是最终的解决方案,但应该这样做。