mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
5
.changeset/tall-carpets-count.md
Normal file
5
.changeset/tall-carpets-count.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/read-modules-dir": patch
|
||||
---
|
||||
|
||||
Fix EMFILE error.
|
||||
@@ -25,5 +25,8 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/pnpm/pnpm/issues"
|
||||
},
|
||||
"funding": "https://opencollective.com/pnpm"
|
||||
"funding": "https://opencollective.com/pnpm",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import gracefulFs from 'graceful-fs'
|
||||
import path from 'path'
|
||||
import util from 'util'
|
||||
|
||||
const readdir = util.promisify(gracefulFs.readdir)
|
||||
|
||||
export default async function readModulesDir (modulesDir: string) {
|
||||
try {
|
||||
@@ -16,7 +19,7 @@ async function _readModulesDir (
|
||||
) {
|
||||
let pkgNames: string[] = []
|
||||
const parentDir = scope ? path.join(modulesDir, scope) : modulesDir
|
||||
for (const dir of await fs.readdir(parentDir, { withFileTypes: true })) {
|
||||
for (const dir of await readdir(parentDir, { withFileTypes: true })) {
|
||||
if (dir.isFile() || dir.name[0] === '.') continue
|
||||
|
||||
if (!scope && dir.name[0] === '@') {
|
||||
|
||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@@ -2676,6 +2676,9 @@ importers:
|
||||
packages/read-modules-dir:
|
||||
specifiers:
|
||||
'@pnpm/read-modules-dir': 'link:'
|
||||
graceful-fs: ^4.2.6
|
||||
dependencies:
|
||||
graceful-fs: 4.2.6
|
||||
devDependencies:
|
||||
'@pnpm/read-modules-dir': 'link:'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user