首页 > 解决方案 > UnhandledPromiseRejectionWarning:错误:ENOENT:没有这样的文件或目录,打开

问题描述

我是新来的,如果我违反了网站的法律或其他什么,我深表歉意,请提醒我。

我目前正在做一个项目,迫切需要帮助。总而言之,我从 GitHub here source code 下载了“Bob-emploi”平台的源代码。根据自述文件,我应该下载 Docker 应用程序并将此命令“docker-compose up -d frontend-dev”应用于 Windows PowerShell,但我遇到了这些问题:

Running node tests…


(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:161) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  download.js
    ✓ should run properly (359ms)
    ✓ should restrict the download to specific table if specified in argument

  aux-pages-redirect lambda function
    ✓ should not touch the landing page
    ✓ redirects "/conseiller/ressources" to the client endpoint "bootstrap"
    ✓ redirects "/eval/" to the client endpoint "eval"
    ✓ redirects "/mini" to the client endpoint "mini-onboarding"
    ✓ redirects "/retours" to the client endpoint "nps"
    ✓ redirects "/statut/" to the client endpoint "statusUpdate"
    ✓ redirects "/unsubscribe" to the client endpoint "unsubscribe"
    ✓ redirects "/conseiller/ressources" to "/bootstrap.html" and the client knows about it
    ✓ redirects "/eval" to "/eval.html" and the client knows about it
    ✓ redirects "/mini" to "/mini-onboarding.html" and the client knows about it
    ✓ redirects "/retours" to "/nps.html" and the client knows about it
    ✓ redirects "/statut" to "/statut.html" and the client knows about it
    ✓ redirects "/unsubscribe" to "/unsubscribe.html" and the client knows about it
    ✓ redirects "/conseiller/nouveau-profil-et-projet" to "/bootstrap.html" and nginx knows about it
(node:161) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
    ✓ redirects "/eval" to "/eval.html" and nginx knows about it
(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
    ✓ redirects "/mini" to "/mini-onboarding.html" and nginx knows about it
(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
    ✓ redirects "/retours" to "/nps.html" and nginx knows about it
(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
    ✓ redirects "/statut" to "/statut.html" and nginx knows about it
(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
(node:161) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/app/release/nginx.conf'
    ✓ redirects "/unsubscribe" to "/unsubscribe.html" and nginx knows about it
(node:161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)


  21 passing (430ms)

Checking Typescript types…
src/components/france_departements.tsx(1700,13): error TS2322: Type '{ children: (Element | Element[])[]; max?: string | number | undefined; required?: boolean | undefined; low?: number | undefined; high?: number | undefined; disabled?: boolean | undefined; ... 355 more ...; viewBox: string; }' is not assignable to type 'SVGProps<SVGSVGElement>'.
  Types of property 'crossOrigin' are incompatible.
    Type 'string | undefined' is not assignable to type '"" | "anonymous" | "use-credentials" | undefined'.
      Type 'string' is not assignable to type '"" | "anonymous" | "use-credentials" | undefined'.
src/components/pages/eval.tsx(766,9): error TS2774: This condition will always return true since the function is always defined. Did you mean to call it instead?
src/components/suggestions.tsx(145,9): error TS2322: Type 'string | null' is not assignable to type 'string'.
  Type 'null' is not assignable to type 'string'.
ERROR: Service 'frontend-dev' failed to build: The command '/bin/sh -c test -n "$SKIP_TEST" && echo "Skipping tests" || ./entrypoint.sh ./lint_and_test.sh' returned a non-zero code: 1

问题截图

问题截图

所以,请问我如何解决这些问题。

标签: node.jsdocker

解决方案


推荐阅读