← All tasks
javascriptshelljs/shelljs #1195Not a task: already works

ERR_PACKAGE_PATH_NOT_EXPORTED for shelljs/plugin and shelljs/global

envgap__shelljs__shelljs-1195

01 / FAILURE SIGNATURE

As reported upstream

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './plugin' is not defined by "exports" in [PATH REDACTED]/shelljs-plugin-open/node_modules/shelljs/package.json
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
c94a3979d0d1ce9d1918d16793b1b2b34b535e4a
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

shelljs/shelljs #1195 · read the original issue
I noticed that plugins cannot import either `require(shelljs/global)` or `require(shelljs/plugin)`.  I'm testing this from the shelljs-plugin-open repository:

```
$ npm run test

node:internal/modules/cjs/loader:591
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './plugin' is not defined by "exports" in [PATH REDACTED]/shelljs-plugin-open/node_modules/shelljs/package.json
    at new NodeError (node:internal/errors:405:5)
    at exportsNotFound (node:internal/modules/esm/resolve:366:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:713:9)
    at resolveExports (node:internal/modules/cjs/loader:584:36)
    at Module._findPath (node:internal/modules/cjs/loader:658:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1120:27)
    at Module._load (node:internal/modules/cjs/loader:975:27)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> ([PATH REDACTED]/shelljs-plugin-open/index.js:2:14)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> ([PATH REDACTED]/shelljs-plugin-open/test/test.js:20:18)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at [PATH REDACTED]/shelljs-plugin-open/node_modules/mocha/lib/mocha.js:250:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles ([PATH REDACTED]/shelljs-plugin-open/node_modules/mocha/lib/mocha.js:247:14)
    at Mocha.run ([PATH REDACTED]/shelljs-plugin-open/node_modules/mocha/lib/mocha.js:576:10)
    at Object.<anonymous> ([PATH REDACTED]/shelljs-plugin-open/node_modules/mocha/bin/_mocha:637:18)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v18.19.1
```

This error is for shelljs/plugin, however if I fix the bug then I get the same error for shelljs/global.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]