简体   繁体   English

无法启动 nodemon 环境

[英]Unable to launch nodemon environment

I'm trying to start my server with nodemon , but it crashes with the following output.我正在尝试使用nodemon启动我的服务器,但它与以下 output 一起崩溃。

The error ERROR: Unrecognized environment. Aborting.错误ERROR: Unrecognized environment. Aborting. ERROR: Unrecognized environment. Aborting. seems quite rare, from a Google search .似乎很少见,来自谷歌搜索

Ran the same code in Windows 10 and a WSL2 Ubuntu set up.在 Windows 10 和 WSL2 Ubuntu 设置中运行相同的代码。 Both had the same results.两者都有相同的结果。 The server does start for my coworker for some reason, though.不过,出于某种原因,服务器确实为我的同事启动。

user@LAPTOP:~/myproject$ npm run start:dev

> myproject@0.0.0 start:dev /home/user/myproject
> nodemon

[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts,html
[nodemon] starting `./node_modules/.bin/ts-node -r tsconfig-paths/register ./src`
[2021-03-23T04:11:42.704Z] ERROR: Unrecognized environment. Aborting.
[nodemon] app crashed - waiting for file changes before starting...
^C
user@LAPTOP:~/myproject$ npm -v
6.14.11
user@LAPTOP:~/myproject$ node -v
v15.12.0

This is a bug with my sequelize code这是我的续集代码的错误

The issue came from trying to access the sequelize.js database before connecting to it.该问题来自于在连接之前尝试访问sequelize.js数据库。

Moving my Model.findAll() statement to after the app has launched has fixed the issue.将我的Model.findAll()语句移到应用程序启动后已解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM