1199 Stimmen

Wie installiert man ein npm-Paket direkt von GitHub

Beim Versuch, Module von GitHub zu installieren, tritt dieser Fehler auf:

ENOENT-Fehler auf package.json.

Einfach reproduzierbar mit express:

npm install https://github.com/visionmedia/express wirft einen Fehler.

npm install express funktioniert.

Warum kann ich nicht von GitHub installieren?

Hier ist die Konsolenausgabe:

npm http GET https://github.com/visionmedia/express.git
npm http 200 https://github.com/visionmedia/express.git
npm ERR! not a package /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/tmp.tgz
npm ERR! Error: ENOENT, open '/home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR!     
npm ERR! or email it to:
npm ERR!     

npm ERR! System Linux 3.8.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "https://github.com/visionmedia/express.git"
npm ERR! cwd /home/guym/dev_env/projects_GIT/proj/somename
npm ERR! node -v v0.10.10
npm ERR! npm -v 1.2.25
npm ERR! path /home/guym/tmp/npm-32312/1373176518024-0.6586997057311237/package/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/guym/dev_env/projects_GIT/proj/somename/npm-debug.log
npm ERR! not ok code 0

1voto

Guillem Puche Punkte 1121

Yarn 2 erfordert den Paketnamen zusammen mit dem GitHub-Repository. Lesen Sie die Dokumentation von Yarn's CLI.

Beispiel: yarn add git@github.com:/.git

-4voto

Rahil Lakhani Punkte 414

Versuchen Sie diesen Befehl:

 npm install github:[Organisation]/[Repository]#[master/BranchName] -g

Dieser Befehl hat bei mir funktioniert:

 npm install github:BlessCSS/bless#3.x -g

CodeJaeger.com

CodeJaeger ist eine Gemeinschaft für Programmierer, die täglich Hilfe erhalten..
Wir haben viele Inhalte, und Sie können auch Ihre eigenen Fragen stellen oder die Fragen anderer Leute lösen.

Powered by:

X