1 关于引入express包报
import express from "express";
^^^^^^
SyntaxError: Cannot use import statement outside a module的问题。
解决方案:
在package.json中添加type:"module"选项
2 'Response' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.报错
解决方案:给 { NextFunction,Request,Response } 添加 type 关键词
import type { NextFunction,Request,Response } from "express"