我有一个关于在本地和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发生了什么的任何建议?