Error: Cannot find module 'node:fs/promises'
See original GitHub issueHi, I’m getting the error:
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'node:fs/promises'
Require stack:
- /Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/file/index.js
- /Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/config/index.js
- /Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/cli.js
- /Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/bin/next-sitemap
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/file/index.js:17:36)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/file/index.js',
'/Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/config/index.js',
'/Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/dist/cjs/cli.js',
'/Users/jonquayle/Sites/next-js-starter/node_modules/next-sitemap/bin/next-sitemap'
]
}
when running the post build script. As far as I know ‘node:fs/promises’ is built into node? Having followed the Read me and various tutorials using next-sitemap, I’m at a loss to know what isn’t quite working. Can anyone shed some light for me please?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Cannot find module 'fs/promises' Electron JS - Stack Overflow
Download the latest stable Node version. This should have the 'fs/promises' module and will fix the issue. · Delete the node_modules folder and ......
Read more >How to solve Cannot find module 'fs/promises'? - Medium
Recently, I need to install npm package name of rotating-file-stream. So, install it and start npm run… npm show error like below: Cannot...
Read more >Node JS Error: Cannot find module 'fs/promises' - Solved
I will explain this example solve error for cannot find module 'fs/promises' in node js. So, let's start following example with output: Solve ......
Read more >Cannot find module 'fs/promises' Error in TypeScript | bobbyhadz
To solve the "Cannot find module fs/promises or its corresponding type declarations" error, install the types for node by running the command npm...
Read more >cannot find module "fs/promises" with nodejs 12.22.7 · Issue #76
It seems Node.js authors was a bit too much furious in changing the fs/promises interface. I've asked on Stack Overflow too...
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
@sandrooco Make sure your node version is >=14.18.3
This still hasn’t been done. Struggled a lot!