npm/npx

[BUG] Script execution fails for scoped packages that contain dependencies

Opened this issue · 0 comments

What / Why

If a package is published to a registry other than npmjs.com (i.e. a GitLab registry), executing scripts from the package will fail if the package contains any dependencies.

If the package contains no dependencies, the script will execute successfully.

When

  • The package is published to a custom registry using a scoped name (i.e. @my-registry/my-package)
  • The package contains dependencies

Where

How

Current Behavior

~/source/npx-test $ npx @testing-npm-registry/npx-test@2
npx: installed 1 in 1.116s
Cannot find module 'moment'
Require stack:
- /Users/nathanfriend/.npm/_npx/89425/lib/node_modules/@testing-npm-registry/npx-test/cli.js

Steps to Reproduce

Complete steps to reproduce, including an example project, can be found at https://gitlab.com/testing-npm-registry/npx-test.

Expected Behavior

~/source/npx-test $ npx @testing-npm-registry/npx-test@2
npx: installed 2 in 1.838s
Hello World!
Today is October 30, 2019

Who

  • n/a

References

  • n/a