Comments (8)
You need a JavaScript platform that understands private class members. That's why there's an engines
field in package.json.
from node-lru-cache.
@isaacs I'm having the same issue, this is my package.json, could you help me to understand what's happening?. Thanks in advance.
{
"name": "NAME",
"version": "1.0.0",
"description": "name",
"main": "app.js",
"scripts": {
"web": "set NODE_ENV=web&& npx nodemon src/app.js",
"dev": "set NODE_ENV=development&& npx nodemon src/app.js",
"qa": "set NODE_ENV=qa&& npx nodemon src/app.js",
"prod": "set NODE_ENV=production&& npx nodemon src/app.js",
"start": "set NODE_ENV=production&& npx nodemon src/app.js",
"sass": "node-sass -w src/scss/ -o public/css/ --recursive"
},
"keywords": [],
"author": "My NAme",
"license": "ISC",
"dependencies": {
"axios": "^0.24.0",
"body-parser": "^1.19.0",
"bootstrap": "^5.2.3",
"bootstrap-icons": "^1.10.5",
"cookie-parser": "^1.4.5",
"cors": "^2.8.5",
"datatables.net": "^1.13.1",
"datatables.net-dt": "^1.13.1",
"dotenv": "^10.0.0",
"ejs": "^3.1.6",
"express": "^4.18.2",
"express-session": "^1.17.3",
"file-saver": "^2.0.5",
"jquery": "^3.6.4",
"jsonwebtoken": "^9.0.0",
"morgan": "^1.10.0",
"msnodesqlv8": "^2.4.0",
"multer": "^1.4.3",
"mysql2": "^3.6.0",
"node-csv": "^0.1.2",
"node-excel-export": "^1.4.4",
"node-vault": "^0.10.2",
"request": "^2.88.2"
},
"devDependencies": {
"nodemon": "^2.0.13"
}
}
What is missing?
from node-lru-cache.
Put this line in your program somewhere:
console.log(process.version)
Run it in the environment where the error occurs. Inspect the output.
Observe that it is not within the stated engines range for this library.
from node-lru-cache.
Solução:
npm uninstall mysql2
npm install [email protected]
from node-lru-cache.
I'm at node version 16.20.2, mysql2 version 3.6 (using lru-cache version 8.0.5) breaks this for me as well. Downgrading to mysql2 version 3.0.0 fixes the problem as stated above since it also lowers the version of lru-cache to before the breaking change, but I can't figure out why.
From node_modules/lru-cache/package.json
(v8.0.5):
"engines": {
"node": ">=16.14"
},
I'm fine downgrading to mysql2 v3.0.0, as it has no special impact on my particular project, but I am still curious why this is not compatible with node 16.20.2.
EDIT: looks like the issue on my system was specific to having multiple node versions installed. I had an old and a new one. Make sure to check using @isaacs suggestion with console.log(process.version)
, rather than running node --version
at the command-line (for example if running under systemd vs. bash)
from node-lru-cache.
Yup. There are few certainties in software development, but if you get a syntax error, then you can guarantee it's running on a VM that doesn't understand how to interpret the syntax in question, every time. That's literally the only way to cause that error. If you think it's running on a VM that does interpret that syntax, then check all the assumptions, because one of them is incorrect, 100% guaranteed. Either it's not running what you think it is, or not running on the version you think it is, etc.
from node-lru-cache.
Related Issues (20)
- Why does the fetch function return void ? HOT 15
- Cannot read private member #keyMap from an object whose class did not declare it HOT 5
- Breaking change on version 7.15.0 - "Uncaught TypeError: LRU is not a constructor" HOT 2
- Engines constraint HOT 1
- Ever endpoint request, cache is empty, what can I fix? HOT 2
- Structural setup around now forbidden undefined and null values (since v8) HOT 2
- dispose/disposeAfter aren't called on replace HOT 1
- Question about cache eviction HOT 3
- Issue with lru-cache npm module: Unexpected token error and unresolved problems HOT 4
- when i refresh the page,the cache data is clear HOT 1
- Nuxt uses lru-cache to refresh the page causing the cache to be empty HOT 1
- Private field '#head' must be declared in an enclosing class HOT 2
- `ttl` documentation HOT 5
- Cache size HOT 1
- Not working with IOS14.x.x versions HOT 1
- Is the signal passed to the fetchMethod always triggering the abort event? HOT 1
- Advice on avoiding fetches being aborted due to eviction HOT 3
- Cache in Remix app always empty? HOT 2
- Type error: 'LRUCache' can only be imported by using a default import HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-lru-cache.