2017-08-01 5 views
0

J'ai un projet qui utilisait à l'origine un paquet npm. J'ai maintenant besoin de fourchette le repo, afin que je puisse faire des changements. Dans mon package.json, j'ai cette ligne:Installez une version fourchue d'un repo, au lieu de NPM.

"react-calendar-timeline": "get-spiffy/react-calendar-timeline", 

puis-je exécuter NPM installer à nouveau mais je reçois cette erreur:

Error in ./src/Schedule.js 
Module not found: 'react-calendar-timeline' in /admin-scheduler/src 

Répondre

0

L'utilisation sous-module:

Vous pouvez ajouter la repo fourchu comme sous-module au dépôt principal.

git submodule add [email protected]:get-spiffy/react-calendar-timeline.git ./path/to/external/dependencies/directory 

Vous pouvez alors vous modifier package.json,

"react-calendar-timeline": "file:./path/to/external/dependencies/directory/react-calendar-timeline", 

En utilisant NPM:

L'autre option pourrait être la publication du paquet NPM. Vous pouvez directement l'ajouter à package.json. Cette ressource sur scoped packages pourrait aider.