Skip to content

require('mysql2') breaks "npm start" #1965

Closed
@h3llyeah

Description

@h3llyeah

If i add to my project
const mysql = require('mysql2');
and launch my nodejs project with npm start

i get error

/nodejs_project/node_modules/lru-cache/dist/cjs/index.js:359
    #initializeTTLTracking() {
                          ^

SyntaxError: Unexpected token '('
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/helar/projects/nodejs/nodejs_udemy/10_sql_intro/node_modules/lru-cache/dist/cjs/index-cjs.js:5:36)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Setup:
OS: Ubuntu 22.04.1 LTS
Nodejs: v12.22.9
mysql2: mysql2@3.2.3

This problem seems to start from verstion mysql2@3.2.1.
mysql2@3.2.0 is ok.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions