清除require的缓存机制,require之前清除缓存
const pkgPath = `${process.cwd()}/package.json`
delete require.cache[require.resolve(pkgPath)]
let projectPkg = require(pkgPath)
清除require的缓存机制,require之前清除缓存
const pkgPath = `${process.cwd()}/package.json`
delete require.cache[require.resolve(pkgPath)]
let projectPkg = require(pkgPath)