path.resolve 打印项目的绝对路径 const path = require(‘path’); console.log(path.resolve(‘a’)); path.resolve 打印项目的绝对路径 dirname 代表的是目录。 相关文章: