如何在package.json中为包提供自定义网址 [英] How to give a custom url in package.json for a package
问题描述
我已经在node_modules
文件夹内的npm package
中完成了自定义.现在,我要在heroku上部署.但是heroku要做的是,它将看到package.json并安装新软件包.
I have done customization in a npm package
inside node_modules
folder. Now I want to deploy it on heroku. But what heroku does is It will see the package.json and install the fresh package.
因此有人建议我为npm软件包提供自定义网址,这样Heroku将从此自定义网址(而不是npm)下载npm软件包.
So someone suggested me to provide the custom url for a npm package, So that Heroku will download the npm package from this custom url not from npm.
我怎么能达到同样的目的?
How can I achieve the same?
推荐答案
您应该派生此包,在派生中进行自定义,然后将版本安装为项目依赖项npm install <git repo url>
You should fork this package, make customization on your fork and install your version as a project dependency npm install <git repo url>
- 找到要在github上自定义的包
- 使用fork按钮将其派生到您的存储库
- 对在步骤2中创建的新存储库进行自定义
- 使用URL地址运行
npm install
到您的存储库
- find package that you want to customise on github
- use fork button to fork it to your repositories
- make customization on this new repo created in step 2
- run
npm install
with url address to your repository
这篇关于如何在package.json中为包提供自定义网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!