在Heroku上安装devDependencies [英] Install devDependencies on Heroku

查看:104
本文介绍了在Heroku上安装devDependencies的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让Heroku在推送后构建我的应用程序,以便在每次进行更改时不必将构建文件夹向上推。然而,heroku只安装package.json和grunt(我的构建工具)的依赖关系,其所有组件都在devDependencies中。我想让他们留在他们所属的地方。这里有什么解决方法?

解决方案

Heroku默认只安装生产依赖项,忽略下的开发依赖项。 devDependencies



设置npm生产变量为 false p>

  heroku config:set NPM_CONFIG_PRODUCTION = false 

更多信息请参阅 Heroku Node.js支持页面


I would like to have Heroku build my app after I push it so that I don't have to push the build folder up every time I make a change. However heroku only installs the dependencies from the package.json and grunt (my build tool) and all of its components are in devDependencies. I would like to keep them there where they belong. What's the workaround here?

解决方案

Heroku by default installs only the production dependencies, ignoring the development dependencies under devDependencies.

Setting the npm production variable to false do the trick:

heroku config:set NPM_CONFIG_PRODUCTION=false

More info are available at the Heroku Node.js Support page.

这篇关于在Heroku上安装devDependencies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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