我想在一个vue-electron项目中使用mssql。我安装了mssql和npm。当我想运行应用程序时,我得到了以下错误:
ERROR Failed to compile with 2 errors
error in ./node_modules/mssql/lib/tedious/connection-pool.js
Module parse failed: Unexpected token (39:63)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| cfg.options.database = cfg.options.database || this.config.database
| cfg.options.port = cfg.options.port || this.config.port
> cfg.options.connectTimeout = cfg.options.connectTimeout ?? this.config.connectionTimeout ?? this.config.timeout ?? 15000
| cfg.options.requestTimeout = cfg.options.requestTimeout ?? this.config.requestTimeout ?? this.config.timeout ?? 15000
| cfg.options.tdsVersion = cfg.options.tdsVersion || '7_4'
@ ./node_modules/mssql/lib/tedious/index.js 4:23-51
@ ./node_modules/mssql/index.js
@ ./src/modules/db.js
@ ./src/background.js
@ multi ./src/background.js
error in ./node_modules/mssql/lib/tedious/request.js
Module parse failed: Unexpected token (446:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const req = new tds.Request(command, err => {
| // tedious v15 has started using AggregateErrors to wrap multiple errors into single error objects
> (err?.errors ? err.errors : [err]).forEach((e, i, { length }) => {
| // to make sure we handle no-sql errors as well
| if (e && (!errors.length || (errors.length && errors.length >= length && e.message !== errors[errors.length - length + i].message))) {
@ ./node_modules/mssql/lib/tedious/index.js 6:16-36
@ ./node_modules/mssql/index.js
@ ./src/modules/db.js
@ ./src/background.js
@ multi ./src/background.js
有人能帮帮我吗?
1条答案
按热度按时间7ivaypg91#
为了将来参考以及通过搜索引擎登录到这里的用户,此错误可能与使用节点〈14的版本有关。使用NVM或其他方法升级到最新的LTS,您应该可以开始了。