The old regex had too many \s to correctly match the module path.
Minimal reproducer:
# Find location of npm on Fedora 29
$find/usr/lib/usr/lib64-path'*/npm/package.json'
/usr/lib/node_modules/npm/package.json
# Try to match the path using the old regex
$find/usr/lib/usr/lib64-path'*/npm/package.json'|grep-E'^/usr/lib(64)?/node_modules/[^/]+/package\\.json$'||echo'NO MATCH'
NOMATCH
The old regex had too many
\s to correctly match the module path.Minimal reproducer:
After the change: