我正在学习本教程:
http://davemax.com/heroku-deploy-yeoman-angular-app/
步骤:
1)$ grunt build --force 2)$ grunt serve dist
应用程序似乎构建良好
然后我创建了一个包含以下内容的procfile:
web: node server/app.js
然后将package.json从路径目录复制并粘贴到dist,添加以下内容:
"scripts": {
"start": "node server/app.js",
"test": "grunt test",
"update-webdriver": "node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update"
},
然后在本地检查应用程序我这样做:
$ foreman start web
我遇到了错误:
20:15:08 web.1 | started with pid 57020
20:15:08 web.1 | module.js:338
20:15:08 web.1 | throw err;
20:15:08 web.1 | ^
20:15:08 web.1 | Error: Cannot find module '/Users/xxx/Desktop/webapp/dist/server/app.js'
20:15:08 web.1 | at Function.Module._resolveFilename (module.js:336:15)
20:15:08 web.1 | at Function.Module._load (module.js:278:25)
20:15:08 web.1 | at Function.Module.runMain (module.js:501:10)
20:15:08 web.1 | at startup (node.js:129:16)
20:15:08 web.1 | at node.js:814:3
20:15:08 web.1 | exited with code 1
20:15:08 system | sending SIGTERM to all processes
我的文件夹如下所示:
似乎缺少文件。我已经从.gitignore删除了/ dist。