Ich habe ein Problem mit npm install, da es @ types nicht installiert.NPM kann keine Typen installieren
Dies funktioniert
npm install --save lodash
jedoch für Typen fragen nicht
npm install --save @types/lodash
PS C:\Development\Temp> npm install --save @types/lodash
npm WARN `git config --get remote.origin.url` returned wrong result (git://github.com/types/lodash)
npm WARN `git config --get remote.origin.url` returned wrong result ([email protected]:types/lodash)
npm ERR! git clone [email protected]:types/lodash Cloning into bare repository 'C:\Users\myuser\AppData\Roaming\npm-cache\_git-remotes\git-github-com-types-lodash-9eb5372a'...
npm ERR! git clone [email protected]:types/lodash Host key verification failed.
npm ERR! git clone [email protected]:types/lodash fatal: Could not read from remote repository.
npm ERR! git clone [email protected]:types/lodash
npm ERR! git clone [email protected]:types/lodash Please make sure you have the correct access rights
npm ERR! git clone [email protected]:types/lodash and the repository exists.
npm ERR! addLocal Could not install types/lodash
npm ERR! Error: ENOENT: no such file or directory, stat 'C:\Development\Temp\types\lodash'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 10.0.15063
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramData\\chocolatey\\lib\\npm\\tools\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "@types/lodash"
npm ERR! cwd C:\Development\Temp
npm ERR! node -v v8.6.0
npm ERR! npm -v 1.4.9
npm ERR! path C:\Development\Temp\types\lodash
npm ERR! syscall stat
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Development\Temp\npm-debug.log
npm ERR! not ok code 0
PS C:\Development\Temp>
Dies hat mir meinen Kopf kratzen. Ich habe Chocolatey, NodeJS, NPM aktualisiert, um sicherzustellen, dass sie die neuesten Versionen besitzen. Versuchte die Befehle in leeren Ordnern oder einem vorhandenen TypeScript-Projekt - es könnte sein, dass es verwirrt wird, wenn es in einem Git-Repository ausgeführt wird (Fehler: remote.origin.url). Mit Blick auf die GitHub URL es keinen Sinn macht git: //github.com/types/lodash
ich diese Beispiele aus MSDN Blog - The Future of Declaration Files nahm
Update: Ich habe Node.js deinstalliert und versucht v6.11.3 LTS Neuinstallation oder v8.6.0. Der Befehl @types schlägt jedoch immer noch fehl.
Update 2: Ich habe festgestellt, dass Chocolately die npm-Version maskiert hat. Ich entfernte den Chocolatly-Ordner und rüstete npm laut @Louis-Antwort auf.
Es sieht so aus, als ob Sie einen GitHub-Account mit einem privaten Schlüssel benötigen, der konfiguriert ist, damit er funktioniert. – lilezek
Ja, aber die URL selbst ist falsch github.com/types/lodash ??? – wonea
Funktioniert gut für mich, haben Sie versucht, npm zu aktualisieren? –