Hello…
I’m trying to publish my Rest API (https://geobase-maluju.netlify.app), developed in NestJs, but every time I deploy it I always get the same error:
8:01:09 AM: $ yarn install; yarn build
8:01:10 AM: yarn install v1.22.19
8:01:10 AM: info No lockfile found.
8:01:10 AM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
8:01:10 AM: [1/4] Resolving packages...
8:01:13 AM: warning aws-lambda > aws-sdk > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
8:01:13 AM: warning aws-lambda > aws-sdk > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
8:01:15 AM: warning @nestjs/cli > fork-ts-checker-webpack-plugin > memfs@3.6.0: this will be v4
8:01:19 AM: warning jest > @jest/core > jest-config > glob@7.2.3: Glob versions prior to v9 are no longer supported
8:01:19 AM: warning jest > @jest/core > jest-runtime > glob@7.2.3: Glob versions prior to v9 are no longer supported
8:01:19 AM: warning jest > @jest/core > @jest/reporters > glob@7.2.3: Glob versions prior to v9 are no longer supported
8:01:19 AM: warning jest > @jest/core > jest-config > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
8:01:20 AM: warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > glob@7.2.3: Glob versions prior to v9 are no longer supported
8:01:22 AM: [2/4] Fetching packages...
8:01:34 AM: [3/4] Linking dependencies...
8:01:34 AM: warning " > serverless-offline@14.3.4" has unmet peer dependency "serverless@^4.0.0".
8:01:34 AM: warning " > ts-loader@9.5.1" has unmet peer dependency "webpack@^5.0.0".
8:01:39 AM: [4/4] Building fresh packages...
8:01:41 AM: success Saved lockfile.
8:01:41 AM: Done in 31.10s.
8:01:41 AM: yarn run v1.22.19
8:01:41 AM: $ nest build && cp src/main.handler.ts dist/src
8:01:43 AM: src/geocicle/geocicle.module.ts:4:33 - error TS2307: Cannot find module '@app/geocicle/geoCicle.service' or its corresponding type declarations.
8:01:43 AM: 4 import { GeoCicleService } from '@app/geocicle/geoCicle.service';
8:01:43 AM: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8:01:43 AM: Found 1 error(s).
8:01:43 AM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
8:01:43 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
8:01:43 AM:
8:01:43 AM: "build.command" failed
8:01:43 AM: ────────────────────────────────────────────────────────────────
8:01:43 AM:
8:01:43 AM: Error message
8:01:43 AM: Command failed with exit code 1: yarn install; yarn build (https://ntl.fyi/exit-code-1)
8:01:43 AM:
8:01:43 AM: Error location
8:01:43 AM: In Build command from Netlify app:
8:01:43 AM: yarn install; yarn build
8:01:43 AM:
8:01:43 AM: Resolved config
8:01:43 AM: build:
8:01:43 AM: command: yarn install; yarn build
8:01:43 AM: commandOrigin: ui
8:01:43 AM: environment:
8:01:43 AM: - DATABASE_URL
8:01:43 AM: - JWT_SECRET
8:01:43 AM: publish: /opt/build/repo
8:01:43 AM: publishOrigin: default
8:01:43 AM: functions:
8:01:43 AM: '*':
8:01:43 AM: node_bundler: esbuild
8:01:43 AM: functionsDirectory: /opt/build/repo/netlify/functions
8:01:43 AM: redirects:
8:01:43 AM: - force: true
8:01:44 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
8:01:44 AM: from: /api/*
status: 200
to: /.netlify/functions/api/:splat
redirectsOrigin: config
8:01:44 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:01:44 AM: Failing build: Failed to build site
8:01:44 AM: Finished processing build request in 1m31.569s
I configured netlify.toml:
[functions]
node_bundler = "esbuild"
directory = "netlify/functions"
[[redirects]]
force = true
from = "/api/*"
status = 200
to = "/.netlify/functions/api/:splat"
I’ve already made several adjustments, following the suggestion of other forums, like this one: https://answers.netlify.com/t/netlify-not-deploying-anymore-module-not-found-and-typescript-types-error/123466.
Could someone help me and guide me?