Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'node:path' #825

Closed
P1K3N opened this issue Feb 1, 2023 · 2 comments · Fixed by #832 · May be fixed by OpenSPP/openfn-adaptors#53
Closed

Error: Cannot find module 'node:path' #825

P1K3N opened this issue Feb 1, 2023 · 2 comments · Fixed by #832 · May be fixed by OpenSPP/openfn-adaptors#53
Labels

Comments

@P1K3N
Copy link

P1K3N commented Feb 1, 2023

Hi!
I'm trying to use tsup in my project but I receive the current error message when I try to build the project:

Error: Cannot find module 'node:path'
Require stack:

  • /Users/bernardo.rodrigues/Documents/service/node_modules/rollup/dist/shared/rollup.js
  • /Users/bernardo.rodrigues/Documents/service/node_modules/rollup/dist/rollup.js
  • /Users/bernardo.rodrigues/Documents/service/node_modules/tsup/dist/index.js
  • /Users/bernardo.rodrigues/Documents/service/node_modules/tsup/dist/chunk-PDM6VDW3.js
  • /Users/bernardo.rodrigues/Documents/service/node_modules/tsup/dist/cli-default.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (/Users/bernardo.rodrigues/Documents/service/node_modules/rollup/dist/shared/rollup.js:12:19)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! rl-rewards-service@0.0.1 build: tsup src/index.ts
    npm ERR! Exit status 1

I'm running Nodejs v14 is this a problem? I couldn't find the minimum requirements to use the package

"engines": {
"node": ">=14.17.0",
"npm": "~6.14.13"
},

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@rayzr522
Copy link
Contributor

rayzr522 commented Feb 11, 2023

the issue is that node:path wasn't available until v14.18:
image
(source)

but you're on v14.17. rollup's package.json actually does indicate this requirement:
image

so upgrading to the latest node v14 should fix your problem, but at the same time I recommend you actually upgrade to the current node lts (v18 as of writing this), as v14 is about to hit EOL:
image
(source)

edit: it might be nice to update the currently overly broad engine range of >=14 in this lib to >=14.8 to align w/ rollup:

"node": ">=14"

edit 2: opened a PR to raise the node engine requirement

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 6.6.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants