Search code examples
node.jsgitnpmsharepointframeworkmicrosoft-graph-toolkit

Can't install @microsoft/mgt via npm


everyone,

when trying to install the package for the MS Graph toolkit via

npm install @microsoft/mgt

I receive an error that the typescript-typings package can not be found:

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://[email protected]/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

I tried several node versions via nodist. And also started a new project with the same results. I use Windows 10 (1903).

Thank you for your help.


Solution

  • Looks like you might not have git installed - You need to install git in your machine to have it working.

    undefined ls-remote -h -t ssh://[email protected]/microsoftgraph/msgraph-typescript-typings.git
    

    it should have been

    git ls-remote -h -t ssh://[email protected]/microsoftgraph/msgraph-typescript-typings.git
    

    There is error related to git path.