Closed missuo closed 1 year ago
I noticed that the start command in package.json is node dist/src/index.js, but there is no dist directory in the project, so it won't start.
package.json
node dist/src/index.js
dist
npm run dev is fine!
npm run dev
➜ chatapi-single git:(main) ✗ npm run start > chatgpt-api-single@1.0.0 start > node dist/src/index.js node:internal/modules/cjs/loader:1063 throw err; ^ Error: Cannot find module '/Users/vincent/Downloads/chatapi-single/dist/src/index.js' at Module._resolveFilename (node:internal/modules/cjs/loader:1060:15) at Module._load (node:internal/modules/cjs/loader:905:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v19.6.0
Need to do npm run build first, and then maybe to modify package.json, since only dist/index.js exists.
npm run build
dist/index.js
I noticed that the start command in
package.json
isnode dist/src/index.js
, but there is nodist
directory in the project, so it won't start.npm run dev
is fine!