Vercel NodeJS Ошибка развертывания приложения: не удается найти модуль './dist/cli.js' и т. Д. - PullRequest
0 голосов
/ 01 августа 2020

Я сделал приложение Sapper, приложение NodeJS, которое отлично работает на моем локальном хосте и linux сервере, но когда я пытаюсь развернуть его на vercel, оно продолжает выдавать мне эту ошибку.

10:19:52.559    Running "npm run build"
10:19:52.742    > HAS-LIBRARY@0.0.1 build /vercel/6e2526b7
10:19:52.742    > CONFIG=./config.json sapper build --legacy
10:19:52.784    internal/modules/cjs/loader.js:983
10:19:52.784      throw err;
10:19:52.784      ^
10:19:52.784    Error: Cannot find module './dist/cli.js'
10:19:52.784    Require stack:
10:19:52.784    - /vercel/6e2526b7/node_modules/.bin/sapper
10:19:52.784        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
10:19:52.784        at Function.Module._load (internal/modules/cjs/loader.js:862:27)
10:19:52.784        at Module.require (internal/modules/cjs/loader.js:1042:19)
10:19:52.784        at require (internal/modules/cjs/helpers.js:77:18)
10:19:52.784        at Object.<anonymous> (/vercel/6e2526b7/node_modules/.bin/sapper:2:1)
10:19:52.784        at Module._compile (internal/modules/cjs/loader.js:1156:30)
10:19:52.784        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
10:19:52.784        at Module.load (internal/modules/cjs/loader.js:1000:32)
10:19:52.784        at Function.Module._load (internal/modules/cjs/loader.js:899:14)
10:19:52.784        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
10:19:52.784      code: 'MODULE_NOT_FOUND',
10:19:52.784      requireStack: [ '/vercel/6e2526b7/node_modules/.bin/sapper' ]
10:19:52.784    }
10:19:52.786    npm ERR! code ELIFECYCLE
10:19:52.786    npm ERR! errno 1
10:19:52.787    npm ERR! HAS-LIBRARY@0.0.1 build: `CONFIG=./config.json sapper build --legacy`
10:19:52.787    npm ERR! Exit status 1
10:19:52.787    npm ERR! 
10:19:52.787    npm ERR! Failed at the HAS-LIBRARY@0.0.1 build script.
10:19:52.787    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10:19:52.790    npm ERR! A complete log of this run can be found in:
10:19:52.791    npm ERR!     /vercel/.npm/_logs/2020-08-01T01_19_52_787Z-debug.log
10:19:52.795    Error: Command "npm run build" exited with 1
...