如何在package.json中为包提供自定义网址 [英] How to give a custom url in package.json for a package

查看:650
本文介绍了如何在package.json中为包提供自定义网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在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>

  1. 找到要在github上自定义的包
  2. 使用fork按钮将其派生到您的存储库
  3. 对在步骤2中创建的新存储库进行自定义
  4. 使用URL地址运行npm install到您的存储库
  1. find package that you want to customise on github
  2. use fork button to fork it to your repositories
  3. make customization on this new repo created in step 2
  4. run npm install with url address to your repository

这篇关于如何在package.json中为包提供自定义网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆