javascript-tutorial / server

Server for the Modern Javascript Tutorial
https://javascript.info
Other
450 stars 137 forks source link

Fail setup at step 6 `./edit en` #106

Open shallow-beach opened 2 months ago

shallow-beach commented 2 months ago

I am on up-to-date MacOS on ARM.

I followed the README, and get stuck at step 6 with the following error:

$ ./edit en                                         
TypeError: LRUCache is not a constructor
    at new RequestCaptureStream (/Users/shallow-beach/js-info/server/modules/engine/log/requestCaptureStream.js:37:23)
    at Object.<anonymous> (/Users/shallow-beach/js-info/server/modules/engine/log/streams.js:37:17)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/shallow-beach/js-info/server/modules/engine/log/index.js:23:15)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)

I am just using the current master branch of .info. Anyone bumped into this before?

RyBhrdwj commented 2 months ago

Yup, I encountered the same issue. You just need to fix the import statement. Replace the import of 'lru-cache' in /Users/shallow-beach/js-info/server/modules/engine/log/requestCaptureStream.js with let LRUCache = require('lru-cache');

tarasyyyk commented 1 month ago

Just add "lru-cache": "^11.0.0" to package.json > "dependencies"