Skip to content

npm packages using local paths are not supported. #107

Closed
@michalczaplinski

Description

@michalczaplinski

Describe the bug:

The runtime does not support local npm packages using the "packageName": "file:./package" syntax.

Link to the blitz that caused the error:

https://stackblitz.com/edit/node-5ppqi3

Steps to reproduce:

npm install 
node index.js
Error: Cannot find module '/projects/node-5ppqi3/node_modules/test-package/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:178912)
    at Function.Module._findPath (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:180576)
    at Function.Module._resolveFilename (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:185323)
    at Function.Module._load (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:183130)
    at Module.require (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:186304)
    at i (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:484674)
    at _0x1cc684 (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:11:20414)
    at Object.eval (/projects/node-5ppqi3/index.js:2:14)
    at Object.function (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:11:20499)
    at Module._compile (https://node-5ppqi3.jw.staticblitz.com/blitz.57be275669708b1d42e233d60c80159bef577631.js:6:187549) {
  code: 'MODULE_NOT_FOUND',
  path: '/projects/node-5ppqi3/node_modules/test-package/package.json',
  requestPath: 'test-package'
}

Expected behavior:

Should run successfully

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: chrome
  • Version: 90

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions