path.dirname on Windows path is giving `.`
问题 I in electron am doing: path.dirname('C:\\Users\\Blagoh\\Documents\\GitHub\\Screeenshoter\\dist\\electron\\main') That path is the actual value of my __dirname . How come it is not giving me C:\\Users\\Blagoh\\Documents\\GitHub\\Screeenshoter\\dist\\electron ? I want that main part chopped off. 回答1: Assuming main is a directory inside electron . Also assuming that you have some file called index.js inside main folder where you want to have the path of electron directory . So, you can do path