Closed CooperJiang closed 1 year ago
+1
I'm pretty sure this relates to using ESM instead of commonjs. From what I remember, pkg doesn't support ecmascript, but I don't have the time to verify that claim, so it's just an idea for you to pursue to see if using commonjs instead works for you
found the reference in the pinned issue: https://github.com/vercel/pkg/issues/1291
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.
What version of pkg are you using?
5.8.1
What version of Node.js are you using?
node 18.15.0
What operating system are you using?
macOS
What CPU architecture are you using?
Intel
What Node versions, OSs and CPU architectures are you building for?
node18-mac-x64
Describe the Bug
Node.js v18.5.0 /snapshot/chatgpt-cooper/node_modules/.pnpm/registry.npmmirror.com+axios@1.3.4/node_modules/axios/lib/helpers/speedometer.js:55 export default speedometer; ^^^^^^
SyntaxError: Unexpected token 'export' at new Script (node:vm:102:7) at Socket. ([eval]:18:19)
at Socket.emit (node:events:537:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
Expected Behavior
I used to package my Nestjs project, and my node version is 18.15.0. This error occurs: Unexpected token 'export'
To Reproduce