获取错误找不到模块:postgres heroku app

时间:2017-01-08 06:47:10

标签: node.js heroku npm npm-install heroku-postgres

我正在尝试将postgres附加组件合并到也使用react的heroku应用程序中。当我尝试在本地运行应用程序时,我收到以下错误:

> heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[WARN] ENOENT: no such file or directory, open 'Procfile'
[OKAY] package.json file found - trying 'npm start'
9:21:18 PM web.1 |  > test-app@0.1.0 start /Users/oliverpike/dev/heroku/ofp-react
9:21:18 PM web.1 |  > react-scripts start
9:21:19 PM web.1 |  Starting the development server...
9:21:25 PM web.1 |  Failed to compile.
9:21:25 PM web.1 |  Error in ./~/dns/~/native-dns/lib/server.js
9:21:25 PM web.1 |  Module not found: 'dgram' in /Users/oliverpike/dev/heroku/ofp-react/node_modules/dns/node_modules/native-dns/lib

显然dgram是根据这个SO线程构建到节点中的: Does node.js have built-in support for UDP(datagams)?

这是npm i dgram的输出:

> npm i dgram
dgram@1.0.1 node_modules/dgram

1 个答案:

答案 0 :(得分:0)

显然,您尝试在客户端应用程序中使用Sequelize和pg Node模块,但此模块只在Node环境中运行,不应在客户端应用程序中使用。