The "ReferenceError: path is not defined" occurs when we use the path module without importing it in a Node.js application.So you only need to required library at the head of your file
const path = require('path');
Copyright © 2025 datapearls.org