【问题标题】:Can't install @microsoft/mgt via npm [duplicate]无法通过 npm 安装@microsoft/mgt [重复]
【发布时间】:2020-03-11 20:44:36
【问题描述】:

大家,

尝试通过

安装 MS Graph 工具包的包时

npm install @microsoft/mgt

我收到一个找不到 typescript-typings 包的错误:

PS C:\Users\dev\Dev\Webpart> npm install @microsoft/mgt
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/microsoftgraph/msgraph-typescript-typings.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dev\AppData\Roaming\npm-cache_logs\2020-03-11T11_44_15_649Z-debug.log

我通过 nodist 尝试了几个节点版本。并且还开始了一个具有相同结果的新项目。 我使用的是 Windows 10 (1903)。

感谢您的帮助。

【问题讨论】:

  • 感谢您的提示。我确实通过 git bash 安装了 git,但它没有设置为我的 PATH。在安装 npm 包之前从未遇到过这个问题。

标签: node.js git npm sharepointframework microsoft-graph-toolkit


【解决方案1】:

看起来你可能没有安装 git - 你需要在你的机器上安装 git 才能让它工作。

undefined ls-remote -h -t ssh://git@github.com/microsoftgraph/msgraph-typescript-typings.git

应该是的

git ls-remote -h -t ssh://git@github.com/microsoftgraph/msgraph-typescript-typings.git

git 路径有错误。

【讨论】:

  • 感谢您的提示。我确实通过 git bash 安装了 git,但它没有设置为我的 PATH。
猜你喜欢
  • 2016-06-14
  • 2017-12-10
  • 2011-09-01
  • 2013-10-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-12
  • 2021-06-16
相关资源
最近更新 更多