最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - MODULE NOT FOUND Error when trying to deploy code on netlify using CLI. Getting ‘npm run build’ not found issue when t

programmeradmin2浏览0评论

I have tried to deploy my express project on netlify(doesn’t have any frontend). I have followed this tutorial - tutorial but I was facing an issue at the build time

6:10:44 PM: Netlify Build 6:10:44 PM: ──────────────────────────────────────────────────────────────── 6:10:44 PM: ​ 6:10:44 PM: ❯ Version 6:10:44 PM: @netlify/build 29.58.3 6:10:44 PM: ​ 6:10:44 PM: ❯ Flags 6:10:44 PM: accountId: 678a602a81665b006edfb731 6:10:44 PM: baseRelDir: true 6:10:44 PM: buildId: 678ba1081da0899354e11f8a 6:10:44 PM: deployId: 678ba1081da0899354e11f8c 6:10:44 PM: ​ 6:10:44 PM: ❯ Current directory 6:10:44 PM: /opt/build/repo 6:10:44 PM: ​ 6:10:44 PM: ❯ Config file 6:10:44 PM: /opt/build/repo/netlify.toml 6:10:44 PM: ​ 6:10:44 PM: ❯ Context 6:10:44 PM: production 6:10:44 PM: ​ 6:10:44 PM: Build command from Netlify app 6:10:44 PM: ──────────────────────────────────────────────────────────────── 6:10:44 PM: ​ 6:10:44 PM: $ npm run build 6:10:44 PM: > [email protected] build 6:10:44 PM: > netlify deploy --prod 6:10:46 PM: Logging into your Netlify account… 6:10:46 PM: Opening netlify response_type=ticket&ticket=f53aabbdce99ff481c3ce29c23383132 6:10:46 PM: - Waiting for authorization… 6:15:46 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for nocode changes) 6:15:46 PM: › Error: Timed out waiting for authorization. If you do not have a Netlify account, please create one at , then run netlify login again. 6:15:46 PM: ​ 6:15:46 PM: “buildmand” failed 6:15:46 PM: ──────────────────────────────────────────────────────────────── 6:15:46 PM: ​ 6:15:46 PM: Error message 6:15:46 PM: Command failed with exit code 1: npm run build (exit-code-1) 6:15:46 PM: ​ 6:15:46 PM: Error location 6:15:46 PM: In Build command from Netlify app: 6:15:46 PM: npm run build 6:15:46 PM: ​ 6:15:46 PM: Resolved config 6:15:46 PM: build: 6:15:46 PM: command: npm run build 6:15:46 PM: commandOrigin: ui 6:15:46 PM: publish: /opt/build/repo/dist 6:15:46 PM: publishOrigin: ui 6:15:46 PM: functionsDirectory: /opt/build/repo/functions 6:15:46 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 6:15:46 PM: Failing build: Failed to build site 6:15:47 PM: Finished processing build request in 5m43.296s

and when I tried to deploy using ‘npm un build’ command locally I was getting this error

❯ Context :heavy_check_mark: Finished uploading blobs to deploy store :heavy_check_mark: No cached functions were found ⠴ Hashing index.html › Warning: { “code”: “MODULE_NOT_FOUND”, “requireStack”: [ “/Users/pinreddy/.nvm/versions/node/v20.17.0/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/zisi/resolve.js” ] }

› Error: In file “/Users/pinreddy/Desktop/foodCourt/backend/functions/app.js” Cannot find module ‘call-bound’ Require stack:

/Users/pinreddy/.nvm/versions/node/v20.17.0/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/zisi/resolve.js can someone check on this I tried - fix but had no luck.

Tried deleting and reinstalling the npm node modules, tried with the following build command CI= npm run build.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论