# ExpressStudy **Repository Path**: XuNeverMore/express-study ## Basic Information - **Project Name**: ExpressStudy - **Description**: express + ts 学习 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-04 - **Last Updated**: 2024-01-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: Nodejs, TypeScript, Express ## README [Express](https://www.expressjs.com.cn/) [Mongoose](https://mongoosejs.com/docs/index.html) ## 创建项目文件 ``` npx express-generator --no-vew app ``` ## 安装 - nrm - nrm ls 镜像列表 - nrm use taobao 使用淘宝镜像 - 镜像 `npm config set registry https://registry.npm.taobao.org/` ``` npm install all ``` ## 运行 ``` $env:DEBUG='myapp:*'; npm start ``` ## TS ``` npm install -g typescript npx tsc --init npm install @types/express tsc ``` - 终端-运行任务-tsc 监视:这样可以监视文件变化,自动编译 ts ## 热重载工具 - `npm install -g nodemon`不用重启服务器即可更新 web - `npm install --save-dev nodemon` ## MongoDB ### 安装失败 - 以管理员身份运行命令提示符或 PowerShell: 在启动 MongoDB 服务之前,请确保您使用管理员权限打开命令提示符或 PowerShell。右键单击命令提示符或 PowerShell 快捷方式,然后选择“以管理员身份运行”。 检查服务账户权限: 检查 MongoDB 服务的运行账户是否具有启动服务的权限。可以通过以下步骤进行检查: - 打开服务管理器:按 Win + R 键,输入 services.msc,然后按回车。 找到 MongoDB 服务,右键单击,选择“属性”。 转到“登录”选项卡,确保服务账户有足够的权限。