heroku节点mongodb,`require未定义`

时间:2017-01-09 19:05:44

标签: node.js mongodb heroku

我有一个关于在本地和heroku运行我的seedDB.js的问题。目前我有:

  • npm start以状态运行:已连接到开发数据库
  • webpack --w正常运行
  • mongod以状态运行:
    • MongoDB starting : pid=28871 port=27017 dbpath=/data/db
    • waiting for connections on port 27017

但是当我跑mongo host:port/db -u user -p pass yourSeedFile.js时,我得到了:

MongoDB shell version: 3.2.6
connecting to: localhost:27017/appName
2017-01-09T11:02:22.605-0800 E QUERY    [thread1] ReferenceError: require is not defined :
@yourSeedFile.js:1:5

有关PLZ发生了什么的任何建议?

0 个答案:

没有答案