简体   繁体   中英

How to get real absolute path with node.js path module

Running below code brings me path without project folder

const path = require('path') 
const absolutepath = path.resolve(argv.directory)

D:\\packages\\example\\dist

However real absolute path is

D:\project\packages\example\dist

Can someone help me , why I cant get project folder in absolute path

Simply with :

__dirname

Example :

console.log( __dirname )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM