Skip to content

Commit

Permalink
Update reify.js
Browse files Browse the repository at this point in the history
Resolution attempt for npm#6412.

Unfortunately, resolution of that issue introduces another error; `Tracker "idealTree" already exists`.
  • Loading branch information
TheCSDev committed Nov 9, 2024
1 parent 780afc5 commit c35af7c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions workspaces/arborist/lib/arborist/reify.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const hgi = require('hosted-git-info')
const rpj = require('read-package-json-fast')

const { dirname, resolve, relative, join } = require('node:path')
const { existsSync } = require("node:fs")
const { depth: dfwalk } = require('treeverse')
const {
lstat,
Expand Down Expand Up @@ -123,10 +124,12 @@ module.exports = cls => class Reifier extends cls {
// we do NOT want to set ownership on this folder, especially
// recursively, because it can have other side effects to do that
// in a project directory. We just want to make it if it's missing.
await mkdir(resolve(this.path), { recursive: true })
let resolvedPath = resolve(this.path);
if(!existsSync(resolvedPath))
await mkdir(resolvedPath, { recursive: true })

// do not allow the top-level node_modules to be a symlink
await this.#validateNodeModules(resolve(this.path, 'node_modules'))
await this.#validateNodeModules(resolve(resolvedPath, 'node_modules'))
}
await this[_loadTrees](options)

Expand Down

0 comments on commit c35af7c

Please sign in to comment.