Package.json:
{
"private": true,
"scripts": {
...
},
"devDependencies": {
"axios": "^0.18",
"babel-preset-react": "^6.23.0",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^2.0",
"lodash": "^4.17.4",
"popper.js": "^1.12",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"gh-pages": "^2.0.1",
"react-icons": "^3.2.2",
"react-redux": "^5.0.7",
"react-scripts": "1.1.5",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",
"styled-components": "^4.0.2"
},
"dependencies": {
"react-router-dom": "^4.3.1"
}
}在部署了laravel应用程序(与react)后,我出现了错误:
Uncaught Error: Cannot find module "react-redux"我有一个空白的站点,上面的错误在控制台中。
发布于 2018-12-05 23:24:02
在默认情况下,Heroku只在部署上安装产品依赖项,因此通过运行dependencies package.json列出了在您的npm install --production键下列出的产品依赖项。
将对运行应用程序至关重要的依赖项从devDependencies移动到dependencies,这将解决您的问题。
devDependencies用于支持您的开发,但您的应用程序的生产副本不需要运行,例如测试模块。
https://stackoverflow.com/questions/53641512
复制相似问题