hqjs / hq

Lightning fast, zero configuration, web application development server
https://hqjs.org
MIT License
126 stars 11 forks source link

Cannot resolve package main #19

Closed toniengelhardt closed 4 years ago

toniengelhardt commented 4 years ago

I get this error when trying to start the dev server with

hq

Console error log:

(c) hqjs @ 0.0.21
internal/modules/esm/default_resolve.js:96
  let url = moduleWrapResolve(specifier, parentURL);
            ^

Error: Cannot resolve package main '[object Object]' in/usr/local/lib/node_modules/@hqjs/hq/node_modules/koa/package.json, imported from /usr/local/lib/node_modules/@hqjs/hq/server.mjs
    at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:96:13)
    at Loader.resolve (internal/modules/esm/loader.js:73:33)
    at Loader.getModuleJob (internal/modules/esm/loader.js:147:40)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:41:40)
    at link (internal/modules/esm/module_job.js:40:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
hqjs commented 4 years ago

Can you please provide your nodejs version and operation system name?

toniengelhardt commented 4 years ago

Yes of course:

Node v13.3.0
OS X 10.15.5 (19F101)
hqjs commented 4 years ago

I can reproduce, seems like some problem with module loader in that specific node version.

Please try to use different nodejs version. I've check it works with 12.16.1, 13.10.1, 14.0.0

toniengelhardt commented 4 years ago

13.10.1 works thanks!

hqjs commented 4 years ago

You are welcome! You can probably try different 13.x.x, I tried random versions that I have installed in my system. It just that specific version (and might be some others as well) that has this problem with the loader. I'll try to investigate anyway, but chances for simple solution are low and effort might not worth to spend time on the fix.

toniengelhardt commented 4 years ago

Totally agree! Thanks so much for the fast resolution.