Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new-space fails locally with Node 20.4.0, NPM 9.8.0 #84

Open
peter-kehl opened this issue Jul 7, 2023 · 1 comment
Open

new-space fails locally with Node 20.4.0, NPM 9.8.0 #84

peter-kehl opened this issue Jul 7, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@peter-kehl
Copy link

peter-kehl commented Jul 7, 2023

Summary: Can't run new-space branch (63cf695) locally (with Node 20.4.0, NPM 9.8.0). (But, it seems to run well on Deta.Space.)

🐞 Describe the bug

Hi Maximilian or friend,

Thank you for Deta & WebCrate. Looking forward to using them & contributing.

Environment: Current Manjaro (stable Arch, x64) Linux (current stable kernel 6.3.5-2), Node 20.4.0, NPM 9.8.0 (installed via nvm). (All the below is running not as root/via sudo, but as an ordinary user.)

FIRST: (but potentially unrelated): Instead of space dev I've tried npm run build. That complained about needing rimraf. So I've installed it with npm install rimraf.
FYI: That reports: 78 vulnerabilities (51 moderate, 25 high, 2 critical).

SECOND:

space --version
space version 0.3.13
space dev

Checking for running micros...

 Starting 1 micro servers...

Micro app (primary)
L url: http://localhost:4200/

[app] 
[app] > webcrate@1.4.3 start
[app] > NODE_ENV=production node build/index.js
[app] 
[app] 
[app] node:internal/modules/cjs/loader:1051
[app]   throw err;
[app]   ^
[app] 
[app] Error: Cannot find module '/share/pkehl/GIT/webcrate/build/index.js'
[app]     at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
[app]     at Module._load (node:internal/modules/cjs/loader:901:27)
[app]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
[app]     at node:internal/main/run_main_module:23:47 {
[app]   code: 'MODULE_NOT_FOUND',
[app]   requireStack: []
[app] }
[app] 
[app] Node.js v20.4.0
[app] 
Command `/home/pkehl/.nvm/versions/node/v20.4.0/bin/npm run start` exited.
Error: Get "http://localhost:4201/__space/actions": dial tcp [::1]:4201: connect: connection refused

THIRD: on Deta.Space:

space new
...
space push
...
Checking for running micros...

 Starting 1 micro servers...

Micro app (primary)
L url: http://localhost:4200/

[app] 
[app] > webcrate@1.4.3 start
[app] > NODE_ENV=production node build/index.js
[app] 
[app] 
[app] node:internal/modules/cjs/loader:1051
[app]   throw err;
[app]   ^
[app] 
[app] Error: Cannot find module '/share/pkehl/GIT/webcrate/build/index.js'
[app]     at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
[app]     at Module._load (node:internal/modules/cjs/loader:901:27)
[app]     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
[app]     at node:internal/main/run_main_module:23:47 {
[app]   code: 'MODULE_NOT_FOUND',
[app]   requireStack: []
[app] }
[app] 
[app] Node.js v20.4.0
[app] 
Command `/home/pkehl/.nvm/versions/node/v20.4.0/bin/npm run start` exited.
Error: Get "http://localhost:4201/__space/actions": dial tcp [::1]:4201: connect: connection refused
...

# BUT, SURPRISINGLY:
2023/07/06 15:16:21 All micros built successfully
...
2023/07/06 15:16:44 starting installation...
...
2023/07/06 15:17:24 completed...
                                                                  
✓ Successfully pushed your code and updated your Builder instance!
# That seems to run well (so far).

Please, shed some light. Node/NPM is outside of my expertise, but wherever I can, I'll contribute, I'll update docs...

Thank you in advance for any tips on developing locally.

@peter-kehl peter-kehl added the bug Something isn't working label Jul 7, 2023
@peter-kehl
Copy link
Author

UPDATE:
After applying steps from https://github.com/WebCrateApp/webcrate/blob/master/CONTRIBUTING.md:

❯ npm run dev

> webcrate@1.4.3 predev
> npm run clean


> webcrate@1.4.3 clean
> rimraf dist build .nuxt


> webcrate@1.4.3 dev
> nuxt


 ERROR  ServerMiddleware Error: Cannot find module './router/index.js'
Require stack:
- /share/pkehl/GIT/webcrate/server/index.ts

  Require stack:
  - server/index.ts
  at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
  at Function.resolve (node:internal/modules/helpers:125:19)
  at _resolve (node_modules/jiti/dist/jiti.js:1:244204)
  at jiti (node_modules/jiti/dist/jiti.js:1:246368)
  at server/index.ts:10:37
  at Resolver.jiti [as _require] (node_modules/jiti/dist/jiti.js:1:248448)
  at Resolver.requireModule (node_modules/@nuxt/core/dist/core.js:381:29)
  at Server._requireMiddleware (node_modules/@nuxt/server/dist/server.js:836:39)
  at Server._normalizeMiddleware (node_modules/@nuxt/server/dist/server.js:783:25)
  at Server.resolveMiddleware (node_modules/@nuxt/server/dist/server.js:856:23)
  at Server.useMiddleware (node_modules/@nuxt/server/dist/server.js:885:36)
  at Server.setupMiddleware (node_modules/@nuxt/server/dist/server.js:715:12)
  at async Server.ready (node_modules/@nuxt/server/dist/server.js:640:5)
  at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:482:7)


   ╭──────────────────────────────────────────╮
   │                                          │
   │   Nuxt @ v2.15.8                         │
   │                                          │
   │   ▸ Environment: development             │
   │   ▸ Rendering:   client-side             │
   │   ▸ Target:      static                  │
   │                                          │
   │   Listening: http://192.168.0.38:3000/   │
   │                                          │
   ╰──────────────────────────────────────────╯

ℹ Preparing project for development
ℹ Initial build may take a while
ℹ Discovered Components: .nuxt/components/readme.md
✔ Builder initialized
✔ Nuxt files generated

 WARN  Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme


● Client █████████████████████████ building (10%) 1/2 modules 1 active
 node_modules/webpack-hot-middleware/client.js

node:internal/crypto/hash:69
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:138:10)
    at module.exports (/share/pkehl/GIT/webcrate/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/share/pkehl/GIT/webcrate/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/share/pkehl/GIT/webcrate/node_modules/webpack/lib/NormalModule.js:471:10)
    at /share/pkehl/GIT/webcrate/node_modules/webpack/lib/NormalModule.js:503:5
    at /share/pkehl/GIT/webcrate/node_modules/webpack/lib/NormalModule.js:358:12
    at /share/pkehl/GIT/webcrate/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/share/pkehl/GIT/webcrate/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/share/pkehl/GIT/webcrate/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/share/pkehl/GIT/webcrate/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /share/pkehl/GIT/webcrate/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /share/pkehl/GIT/webcrate/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v20.4.0

webcrate on  new-space [!?] via  v20.4.0 took 4s 
❯ node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 173260.
    at /share/pkehl/GIT/webcrate/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: undefined,
  signal: undefined
}

Node.js v20.4.0
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 173259.
    at /share/pkehl/GIT/webcrate/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: undefined,
  signal: undefined
}

Node.js v20.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants