Skip to content

Commit fca270d

Browse files
committed
fix: ensure compatibility with Node 8 by replacing recursive mkdir with explicit calls
1 parent 5cc3037 commit fca270d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/ghsa/GHSA-cp6g-6699-wx9c/repro.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ describe('GHSA-cp6g-6699-wx9c — require.root symlink bypass', () => {
8989
it('rejects directory-level symlink (pnpm/npm-link layout)', () => {
9090
tmp = mkdtemp();
9191
const root = path.join(tmp, 'root');
92-
fs.mkdirSync(path.join(root, 'node_modules'), { recursive: true });
92+
// Two explicit mkdirs instead of {recursive: true} for Node 8 compat
93+
// (fs.mkdirSync recursive option added in Node 10.12).
94+
fs.mkdirSync(root);
95+
fs.mkdirSync(path.join(root, 'node_modules'));
9396

9497
// Outside package: name "safe", payload writes a sentinel.
9598
const outsidePkg = path.join(tmp, 'outside-pkg');

0 commit comments

Comments
 (0)