我有一个已成功部署到heroku的应用程序,但是当我尝试访问它时,出现此屏幕...
我认为引起该问题的错误是Error: Cannot find module 'mongoose'
。
这是我的package.json供参考...
{
"name": "ovo",
"version": "1.0.0",
"description": "see and sort OVO in real time!",
"main": "server.js",
"scripts": {
"build": "webpack --config webpack.prod.config.js",
"dev": "concurrently -k \"npm run frontend\" \"npm run backend\"",
"frontend": "webpack -d --watch",
"backend": "nodemon server.js",
"start": "npm run build && NODE_ENV=production node server.js",
"test": "mocha --compilers js:babel-core/register ./test/**/*.js --require ignore-styles"
},
"engines": {
"node": "6.11.0",
"npm": "5.0.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/leojacoby/ovo.git"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.17.1",
"babel-core": "^6.24.1",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.0",
"enzyme": "^2.8.1",
"expect": "^1.20.2",
"express": "^4.15.2",
"immutability-helper": "^2.6.5",
"mocha": "^3.2.0",
"mongoose": "^5.4.0",
"node-sass": "^4.5.2",
"prop-types": "^15.6.0",
"rc-slider": "^8.6.0",
"rc-tooltip": "^3.7.0",
"react": "^15.5.4",
"react-addons-update": "^15.6.2",
"react-bootstrap-table": "^4.3.1",
"react-bootstrap-table-next": "^0.1.3",
"react-dom": "^15.5.4",
"react-rangeslider": "^2.2.0",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-devtools": "^3.4.0",
"redux-devtools-dock-monitor": "^1.1.2",
"redux-devtools-log-monitor": "^1.3.0",
"sass-loader": "^6.0.3",
"style-loader": "^0.16.1",
"webpack": "^2.3.3"
},
"devDependencies": {
"babel-eslint": "^7.2.2",
"concurrently": "^3.5.0",
"eslint": "^3.19.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.3",
"eslint-watch": "^3.1.0",
"ignore-styles": "^5.0.1",
"nodemon": "^1.11.0",
"react-addons-test-utils": "^15.5.1",
"react-test-renderer": "^15.5.4",
"webpack-dev-middleware": "^1.10.1",
"webpack-dev-server": "^2.4.2",
"webpack-hot-middleware": "^2.18.0"
},
"bugs": {
"url": "https://github.com/leojacoby/ovo/issues"
},
"homepage": "https://github.com/leojacoby/ovo#readme",
"directories": {
"test": "test"
},
"keywords": []
}
'mongoose'npm软件包位于我的package.json中,当我在本地主机上运行该软件包时,一切正常。如果您需要更多信息,请告诉我,谢谢您的阅读!
答案 0 :(得分:0)
您要在代码中推送node_modules吗?如果是,请尝试删除该文件夹,然后让Heroku重新安装所有模块。
答案 1 :(得分:0)