赞
踩
typescript报错:
can only be default-imported using the
‘esModuleInterop’ flag
2 import request from ‘request’
~~~~~~~
…/node_modules/@types/request/index.d.ts:399:1
399 export = request;
This module is declared with using ‘export =’, and can only be used with a default import when using the ‘esModuleInterop’ flag.
can only be default-imported using the
'esModuleInterop' flag
2 import request from 'request'
~~~~~~~
../node_modules/@types/request/index.d.ts:399:1
399 export = request;
This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
解决方案:
import _ = require('mongoose-sequence');
我这里的解决方式为:
import request = require('request');
并不一定能解决你的问题,只是提供一种可能的解决方案
参考:https://stackoverflow.com/questions/57960016/what-does-can-only-be-default-imported-using-the-esmoduleinterop-flag-mean
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。