在部署Grunt应用程序到heroku时,NPM不会安装模块依赖项 [英] NPM doesn't install module dependencies when deploying a Grunt app to heroku

查看:146
本文介绍了在部署Grunt应用程序到heroku时,NPM不会安装模块依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用grunt制作了一个静态单页网站。我现在正在尝试使用

https://gist.github.com/callumflack/8038483 >
web:node index.html



当我 $ git push heroku master Gruntfile并且失败:

  ----->找到Gruntfile,运行grunt heroku:制作任务
>>未找到本地Npm模块grunt-contrib-uglify。它是否安装?

上述错误继续列出所有本地NPM模块未找到。如果我列出所有loadNpmTasks而不是使用load-grunt-tasks,则会得到完全相同的错误。



当我 $ heroku logs 我得到:
$ b $ pre $ 使用命令`node web.js`启动进程
错误:Can not查找模块'/app/web.js'

任何人都可以看到我出错的地方吗?

解决方案

对于经过这里的任何人,我无法解决问题。这是我得到的地方:



在我的Gruntfile中,我将npm模块从devDependencies移动到了依赖项。 Heroku然后能够安装这些依赖项。然而,当Heroku运行这些任务时,它停在haml任务w /错误处你需要安装Ruby和Haml并在你的PATH中完成这项任务。添加红宝石&哈姆到Gruntfile作为引擎不起作用。


I'v made a static single page site using grunt. I'm now trying to deploy it to heroku using the heroku buildpack for node grunt.

Below is a pic of my root directory:

Here's my Gruntfile, package.json & Procfile:

https://gist.github.com/callumflack/8038464
https://gist.github.com/callumflack/8038483
web: node index.html

When I $ git push heroku master it gets to the Gruntfile and fails:

-----> Found Gruntfile, running grunt heroku:production task
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed?

The above errors proceed to list all local NPM modules as not found. If I list all loadNpmTasks instead of using "load-grunt-tasks", I get the exact same error.

When I $ heroku logs I get:

Starting process with command `node web.js`
Error: Cannot find module '/app/web.js'

Can anyone see where I've gone wrong?

解决方案

For anyone passing by here, I wasn't able to solve the problem. This is where I got to:

In my Gruntfile, I moved npm modules from devDependencies to dependencies. Heroku was then able to install these dependencies.

However, when Heroku ran the tasks, it stops at the haml task w/ error "You need to have Ruby and Haml installed and in your PATH for this task to work". Adding ruby & haml to the Gruntfile as engines did not work.

这篇关于在部署Grunt应用程序到heroku时,NPM不会安装模块依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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