help me can't load node module

*ERROR: npm v9.6.5 is known not to run on Node.js v12.22.12. This version of npm supports the following node versions: ^14.17.0 || ^16.13.0 || >=18.0.0. You can find the latest version at

const hasLoadedNpm = npm?.config.loaded

SyntaxError: Unexpected token ‘.’
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at module.exports (/home/runner/-Bots/.config/npm/node_global/lib/node_modules/npm/lib/cli.js:42:23)
at Object. (/home/runner/-Bots/.config/npm/node_global/lib/node_modules/npm/bin/npm-cli.js:2:25)
at Module._compile (internal/modules/cjs/loader.js:999:30)
exit status 1

Maybe try updating your version of Node.js, or try reforking the template. (Deleting and recreating the Repl)

1 Like

Hey, @DogukanAkca1, welcome to Replit Ask.

Adding on to @element1010 you can just copy replit.nix the .replit file for Node.js 18 and you can find them here: for the Nix file and for the .replit file. Doing that is basically Node.js 18 on your project.


Adding on to what @doxr said, if you are unable to copy files from one repl to another, you can go to your replit.nix file and change the following line: pkgs.nodejs-12_x to pkgs.nodejs-18_x, this works for all nix environments.