bug: node protocol unsupported
See original GitHub issueWhen importing the latest tempy
, it fails as it uses the new node:
protocol:
Error: Cannot find module 'node:fs'
Require stack:
- /node_modules/.pnpm/tempy@2.0.0/node_modules/tempy/index.js
- /src/cli.ts
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/node_modules/.pnpm/tempy@2.0.0/node_modules/tempy/index.js:1:42)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at extensions..js (/node_modules/.pnpm/esbuild-register@3.0.0_esbuild@0.13.12/node_modules/esbuild-register/dist/node.js:2703:15)
at Object.newLoader [as .js] (/node_modules/.pnpm/esbuild-register@3.0.0_esbuild@0.13.12/node_modules/esbuild-register/dist/node.js:2262:9)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/node_modules/.pnpm/tempy@2.0.0/node_modules/tempy/index.js',
'/src/cli.ts'
]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Connection closed due to error Error: Unsupported protocol ...
You have made a mistake in your pasting API key. Check your API key it will not be like URL. http:// is missing...
Read more >Hardhat errors | Ethereum development environment for ...
A Solidity file is trying to import a file using an unsupported protocol, like http. You can only import files that are available...
Read more >Common errors | npm Docs
It's most likely a temporary npm registry glitch. Check npm server status and try again later. · If the error persists, perhaps the...
Read more >Node js Error: Protocol "https:" not supported. Expected "http:"
JavaScript : Node js Error : Protocol "https:" not supported. Expected "http:" [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] ...
Read more >Unsupported protocol "undefined" || Solved - YouTube
This video show how to solve connection closed due to errors in Nodejs.Subscribe this channel to get solution for the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🎉 This issue has been resolved in version 3.1.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
It's back-ported:
Using the same version of Node.js, setting
"type": "module"
inpackage.json
, then runningnode index.js
will work fine to resolve thenode:
protocol.I guess this doesn’t work because esbuild converts
import
s torequire
s, which requires 14.18.0.However, given esbuild-register back-ports ESM support to older versions of Node.js, I would expect it to be able to back-port
node:
as well. Surely this is easy as removingnode:
from the specifier.