【问题标题】:getting error Module not found: 'dgram' in postgres heroku app在 postgres heroku 应用程序中找不到错误模块:'dgram'
【发布时间】:2017-03-14 01:47:06
【问题描述】:

我正在尝试将 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

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-08
      • 2019-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-21
      • 1970-01-01
      • 2017-05-22
      相关资源
      最近更新 更多