If you want to use the node: prefixes for builtin modules on repl.it, then (as of May 2021) you need to do a few things:
- In
.replit, add the[packager]section with theignoredPackagesconfiguration seen in the example file below. This will disable the automatic installation on repl.it of these packages. - In
.replit, change the start script toyarn start - In
package.json, add ascriptssection with thestartscript as seen in the example file below. This will transpile away thenode:prefixes for the older Node v12 version using@upleveled/babel-plugin-remove-node-prefix. - Run
yarn add --dev @babel/core @babel/node @upleveled/babel-plugin-remove-node-prefix
Example repl here: https://replit.com/@karlhorky/node-prefix-babel-demo#index.js