geelen/npx-import

Local version mismatch?

geelen opened this issue · 1 comments

One problem is that the native import() doesn't allow a version specifier, so if the consumer project has a version of pkg-a available, npxImport('pkg-a@1.2.3') will use it even if it doesn't match versoin 1.2.3. That's probably something we should warn on...

Update, have an idea that would work:

  • use require.resolve before trying import()
  • walking the directory for package.json, compare version
  • then import() if ok.