` ➜ foxpage git:(main) ✗ npm run init-server:prod
[email protected] init-server:prod /Users/lczq/open/foxpage
cd packages/foxpage-server && cross-env NODE_ENV=production node dist/install.js
mongoose: 40.245ms
Connected to MongoDB database!
MongoError: This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
at getMMAPError (/Users/lczq/open/foxpage/node_modules/mongodb/lib/core/topologies/shared.js:413:18)
at handler (/Users/lczq/open/foxpage/node_modules/mongodb/lib/core/sdam/topology.js:945:15)
at /Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/connection_pool.js:348:13
at handleOperationResult (/Users/lczq/open/foxpage/node_modules/mongodb/lib/core/sdam/server.js:558:5)
at commandResponseHandler (/Users/lczq/open/foxpage/node_modules/mongodb/lib/core/wireprotocol/command.js:120:25)
at MessageStream.messageHandler (/Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/connection.js:272:11)
at MessageStream.emit (events.js:315:20)
at processIncomingData (/Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at Socket.ondata (internal/streams/readable.js:719:22)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10) {
originalError: MongoError: Transaction numbers are only allowed on a replica set member or mongos
at MessageStream.messageHandler (/Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/connection.js:272:20)
at MessageStream.emit (events.js:315:20)
at processIncomingData (/Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/Users/lczq/open/foxpage/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at Socket.ondata (internal/streams/readable.js:719:22)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.Readable.push (internal/streams/readable.js:223:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
ok: 0,
code: 20,
codeName: 'IllegalOperation'
},
insertedDocs: [
{
password: '21232f297a57a5a743894a0e4a801fc3',
nickName: '',
email: '',
registerType: 1,
changePwdStatus: false,
deleted: false,
_id: 624e3ac017bfd1b776388413,
id: 'user_uSloFQcnnMVoHd7',
account: 'admin',
createTime: 2022-04-07T01:13:36.978Z,
updateTime: 2022-04-07T01:13:36.978Z
}
]
}
(node:46966) UnhandledPromiseRejectionWarning: Error: Run mongo transaction error:This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
at OrgModel.exec (/Users/lczq/open/foxpage/packages/foxpage-server/dist/src/models/base-model.js:42:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async OrgService.runTransaction (/Users/lczq/open/foxpage/packages/foxpage-server/dist/src/services/base-service.js:15:9)
at async setupSql (/Users/lczq/open/foxpage/packages/foxpage-server/dist/install.js:71:9)
at async install (/Users/lczq/open/foxpage/packages/foxpage-server/dist/install.js:38:28)
(Use node --trace-warnings ...
to show where the warning was created)
(node:46966) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:46966) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. `
mongodb 版本V5.0.6,数据库连接上已经加了 retryWrites=false
,查了资料后,向跟您确认一下:
- 是否是mongodb 必须配置主从呢?如果不是,需要怎么解决?
- 已经关闭的一个issues里边一个微信群二维码已经过期了,能否发一个新的,谢谢