2016-08-11 4 views
1

ich folgendes hat:npm GitHub Repo-Streifen src Ordner installieren

npm install TuningGuide/react-sortable-hoc --save 
npm info it worked if it ends with ok 
npm info using [email protected] 
npm info using [email protected] 
npm info git [ 'clone', 
npm info git '--template=/Users/velten/.npm/_git-remotes/_templates', 
npm info git '--mirror', 
npm info git 'git://github.com/tuningguide/react-sortable-hoc.git', 
npm info git '/Users/velten/.npm/_git-remotes/git-github-com-tuningguide-react-sortable-hoc-git-78a804e9' ] 
npm info git [ 'rev-list', '-n1', 'master' ] 
npm info git [ 'clone', 
npm info git '/Users/velten/.npm/_git-remotes/git-github-com-tuningguide-react-sortable-hoc-git-78a804e9', 
npm info git '/var/folders/95/ylk5ht9s24n6xk4rcr6sch4r0000gn/T/npm-22395-24e6f9cc/git-cache-220f34bb/09fb1e0c7d657657b9aa091c018b45aee0ed0662' ] 
npm info git [ 'checkout', '09fb1e0c7d657657b9aa091c018b45aee0ed0662' ] 
npm info git [ 'submodule', '-q', 'update', '--init', '--recursive' ] 
npm info attempt registry request try #1 at 14:18:51 
npm http request GET https://registry.npmjs.org/invariant 
npm http 304 https://registry.npmjs.org/invariant 
npm info lifecycle [email protected]~preinstall: [email protected] 
npm info lifecycle [email protected]~preinstall: [email protected] 
npm info linkStuff [email protected] 
npm info linkStuff [email protected] 
npm info lifecycle [email protected]~install: [email protected] 
npm info lifecycle [email protected]~install: [email protected] 
npm info lifecycle [email protected]~postinstall: [email protected] 
npm info lifecycle [email protected]~postinstall: [email protected] 
[email protected] /Users/velten/Websites/typescript-react-mobx-boilerplate 
└─┬ [email protected] (git://github.com/tuningguide/react-sortable-hoc.git#09fb1e0c7d657657b9aa091c018b45aee0ed0662) 
    └── [email protected] 

npm info ok 

folder

Aber der Ordner enthält nicht die Quelle noch die Build. Warum?

+0

Siehe https://github.com/npm/npm/issues/2974 –

+0

Haben Sie versucht, es erneut zu installieren? Ist es das gleiche Ergebnis? –

+0

'npm cache clean' und neu installieren. –

Antwort

2

src/ ist im .npmignore Ordner verboten

(wenn wir über this repo sprechen)
https://github.com/clauderic/react-sortable-hoc/blob/master/.npmignore 

... und die implizite prepublish löst build nur auf eine regelmäßige „veröffentlicht installieren“, nicht, wenn Sie installieren direkt von Github ... (lernte auch das auf die harte Tour).

Versuchen Sie mit jedem bekannten Paket, indem Sie es nicht wie üblich installieren, sondern direkt von github, um es zu überprüfen.

Schmerzhaft, in der Tat. Das Beste, was man in seinen eigenen Repos machen kann, ist der "Preinstall" -Hook. (Und nicht verbieten die src/ -Folder dafür, zu arbeiten).

Sie könnten den Repo-Klon, src/Ordner erlauben (Entfernen von .npmignore) und Build-Prozess verschieben Haken „vorinstallieren“ ...

+0

Irgendwelche Ratschläge, wie man "build-process" auf "hook ..." vorinstalliert? – andrewkittredge

1

Sie müssen möglicherweise files in package.json für Ihr Repo festlegen.

+0

Danke für die Freigabe! –

0

Eine Abhilfe den gesamten Repo-Inhalte zu erhalten, ist aus zu installieren ein Archiv, zum Beispiel (sieht aus wie die Repo clauderic/react-sortable-hoc umbenannt wurde, da die Frage gestellt wurde)

$ npm install https://github.com/clauderic/react-sortable-hoc/archive/v0.6.7.tar.gz

Diese Downloads src/ aber nicht build/, die nicht in git verfolgt wird.

Verwandte Themen