2017-08-01 111 views
0

我有一個最初使用npm軟件包的項目。我現在需要分叉回購,以便我可以對其進行更改。在我的package.json,我有這樣的一行:安裝分叉版本的回購,而不是從NPM

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

然後我跑NPM重新安裝,但我得到這個錯誤:

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

回答

0

使用子模塊:

您可以添加分叉回購作爲主要回購的子模塊。

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

然後可以修改你package.json

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

使用NPM:

另一種選擇,可以發佈NPM包。您可以直接將其添加到package.json。此資源約scoped packages可能會有所幫助。

相關問題