相关疑难解决方法(0)

在将Grunt应用程序部署到heroku时,NPM不会安装模块依赖项

我使用grunt创建了一个静态单页网站.我现在正尝试使用heroku-buildpack-nodejs-grunt将它部署到heroku,用于node grunt.

下面是我的根目录的图片:

项目根目录图像

这是我的Gruntfile package.json:

Procfile:

web: node index.html
Run Code Online (Sandbox Code Playgroud)

当我运行$ git push heroku master它到达Gruntfile并失败:

-----> Found Gruntfile, running grunt heroku:production task
>> Local Npm module "grunt-contrib-uglify" not found. Is it installed?
Run Code Online (Sandbox Code Playgroud)

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

$ heroku logs我得到:

Starting process with command `node web.js`
Error: Cannot find module '/app/web.js'
Run Code Online (Sandbox Code Playgroud)

谁能看到我出错的地方?

json heroku node.js gruntjs

8
推荐指数
1
解决办法
3796
查看次数

标签 统计

gruntjs ×1

heroku ×1

json ×1

node.js ×1