Nest.js-"无效命令:start"

这个应用程序在 Docker 容器中工作了很长时间,最近它甚至没有启动。

这个应用程序在 Docker 容器中工作了很长时间,最近它甚至没有启动。

在 Docker 容器中我有这个错误:

app  | > app@0.0.1 start:debug /srv/app
app  | > nest start --debug 127.0.0.1:9229 --watch
app  | 
app  | Invalid command: start
app  | See --help for a list of available commands.
app  | npm ERR! code ELIFECYCLE
app  | npm ERR! errno 1
app  | npm ERR! app@0.0.1 start:debug: `nest start --debug 127.0.0.1:9229 --watch`
app  | npm ERR! Exit status 1
app  | npm ERR! 
app  | npm ERR! Failed at the app@0.0.1 start:debug script.
app  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
app  | 
app  | npm ERR! A complete log of this run can be found in:
app  | npm ERR!     /root/.npm/_logs/2022-04-07T13_01_07_426Z-debug.log

如果我通过我的机器上的终端启动这个,它只是不启动没有任何错误:

/develop/app -> npm run start     (06:57:32 PM)
> app@0.0.1 start
> nest start
/develop/app ->.                  (06:57:39 PM)

我的 package.json:

{
  "name": "app",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "license": "UNLICENSED",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "start:docker": "docker-compose up --build -V",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug 127.0.0.1:9229 --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },
  "dependencies": {
    "@hapi/joi": "^17.1.1",
    "@nestjs/common": "^8.0.0",
    "@nestjs/config": "^1.0.1",
    "@nestjs/core": "^8.0.6",
    "@nestjs/microservices": "^8.0.11",
    "@nestjs/platform-express": "^8.0.0",
    "@nestjs/serve-static": "^2.2.2",
    "@nestjs/swagger": "^5.0.9",
    "@nestjs/typeorm": "^8.0.2",
    "class-transformer": "^0.4.0",
    "class-validator": "^0.13.1",
    "dotenv": "^10.0.0",
    "joi": "^17.4.2",
    "kafkajs": "^1.15.0",
    "libphonenumber-js": "^1.9.38",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.3.0",
    "swagger-ui-express": "^4.1.6",
    "ua-pr-js": "^1.0.2",
    "xlsx": "^0.18.5"
  },
  "devDependencies": {
    "@nestjs/cli": "^5.6.2",
    "@nestjs/schematics": "^8.0.0",
    "@nestjs/testing": "^8.0.0",
    "@types/convert-excel-to-json": "^1.7.1",
    "@types/express": "^4.17.13",
    "@types/jest": "^27.0.1",
    "@types/multer": "^1.4.7",
    "@types/node": "^14.14.31",
    "@types/supertest": "^2.0.10",
    "@types/ua-pr-js": "^0.7.36",
    "@typescript-eslint/eslint-plugin": "^4.15.2",
    "@typescript-eslint/pr": "^4.15.2",
    "eslint": "^7.20.0",
    "eslint-config-prettier": "^8.1.0",
    "eslint-plugin-prettier": "^3.3.1",
    "jest": "^27.0.6",
    "prettier": "^2.2.1",
    "supertest": "^6.1.3",
    "ts-jest": "^27.0.3",
    "ts-loader": "^8.0.17",
    "ts-node": "^9.1.1",
    "tsconfig-paths": "^3.9.0",
    "typescript": "^4.1.5"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

我的 dockerfile:

FROM node:14.17-alpine
# Copy project to the image
WORKDIR /srv/app
RUN mkdir static
COPY . /srv/app
# Install dependencies
RUN npm install
# Build and run the nest project
CMD ["npm", "run", "start:debug"]

我的配置:macOS Monterey 12.3.1 Btw,另一个开发人员成功启动了这个应用程序。他有一台 Windows 10 机器。

我再说一遍:很长一段时间以来,一切都很正常。package.jsonDockerfile在这段时间内根本没有改变。直到最近才开始出现。

1

@nestjs/clidev 依赖项应该在版本 8 上,其余的@nestjs/依赖项。@nestjs/cliv5 没有start命令

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(526)
雅虎财经对印度NSE BSE的股票报价
上一篇
具有功能组件和格式化程序的 react-jsx-highcharts
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(81条)