node.js - 无法使用 NPM 安装 TypeScript

标签 node.js typescript npm

我无法使用 npm 完成 Typescript 安装。

作为documentation建议我运行以下命令:

npm install -g typescript

sudo npm install -g typescript

-

看起来一切正常,直到进程进行到大约 20% 时它无法继续,这是在 shell 中注销的错误。

npm ERR! fetch failed https://registry.npmjs.org/typescript/-/typescript-1.8.5.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 504
npm ERR! fetch failed https://registry.npmjs.org/typescript/-/typescript-1.8.5.tgz
npm WARN retry will retry, error on last attempt: Error: socket hang up
npm ERR! fetch failed https://registry.npmjs.org/typescript/-/typescript-1.8.5.tgz
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "typescript"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.12

npm ERR! fetch failed with status code 504

最佳答案

前往http://status.npmjs.org/#day所有系统似乎都可以运行。也许只是一个小插曲。再试一次🌹

关于node.js - 无法使用 NPM 安装 TypeScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35736468/

相关文章:

Typescript 继承并重载了函数的字符串文字参数

vue.js - 如何在没有 monorepo 的情况下在多个 vue 应用程序中组织代码(组件)共享

javascript - 从 gulp 中使用 browserify 时如何将 'require' 暴露给浏览器?

javascript - 从 Google Play 商店获取应用程序的屏幕截图

javascript - window.onload 在 Angular 4 中不起作用

npm - 是否可以不使用 npm 5 生成 package-lock.json?

node.js - Yeoman npm 在 Windows 上安装失败

node.js - 如何将文件内容复制到字符串中?

node.js - tsc 未被识别为内部或外部命令

javascript - 当类型不兼容时,如何使 Mongoose 查找查询返回 null 而不是抛出 CastError?