mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Revert "module: fix check for package.json at volume root"
This reverts commit 51af89fe45.
This has needed to be backed out of both the 14.5.0 and 14.6.0
releases due to creating regressions across multiple projects
including:
* coffeescript
* JSONStream
* gulp
* and more
We should reopen a PR to figure out how to land this in a way
that is non-breaking.
Refs: https://github.com/nodejs/node/pull/33476
PR-URL: https://github.com/nodejs/node/pull/34403
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
@@ -49,7 +49,6 @@ const {
|
||||
SafeSet,
|
||||
String,
|
||||
StringPrototypeIndexOf,
|
||||
StringPrototypeLastIndexOf,
|
||||
StringPrototypeMatch,
|
||||
StringPrototypeSlice,
|
||||
StringPrototypeStartsWith,
|
||||
@@ -310,13 +309,12 @@ function readPackageScope(checkPath) {
|
||||
const rootSeparatorIndex = checkPath.indexOf(path.sep);
|
||||
let separatorIndex;
|
||||
while (
|
||||
(separatorIndex = StringPrototypeLastIndexOf(checkPath, path.sep)) >=
|
||||
rootSeparatorIndex
|
||||
(separatorIndex = checkPath.lastIndexOf(path.sep)) > rootSeparatorIndex
|
||||
) {
|
||||
checkPath = checkPath.slice(0, separatorIndex);
|
||||
if (checkPath.endsWith(path.sep + 'node_modules'))
|
||||
return false;
|
||||
const pjson = readPackage(checkPath + path.sep);
|
||||
const pjson = readPackage(checkPath);
|
||||
if (pjson) return {
|
||||
path: checkPath,
|
||||
data: pjson
|
||||
|
||||
Reference in New Issue
Block a user