q2s2t / node-7z

A Node.js wrapper for 7-Zip
https://www.npmjs.org/package/node-7z
ISC License
180 stars 60 forks source link

SyntaxError: Unexpected token ... #62

Closed cyril23 closed 5 years ago

cyril23 commented 5 years ago

On my production system, I received the following error running v1.1.0 of node-7z:

SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node/silexport/node_modules/node-7z/src/main.js:4:15)

My package.json is the following:

{
    "name": "MyName",
    "description": "MyDescription",
    "version": "1.0.0",
    "author": "me",
    "contributors": [],
    "dependencies": {
        "body-parser": "^1.18.3",
        "express": "^4.16.4",
        "request": "^2.88.0",
        "iconv-lite": "^0.4.24",
        "formatcoords": "^1.1.3",
        "mkdirp": "^0.5.1",
        "nodemailer": "^5.1.1",
        "jimp": "^0.6.0",
        "json2csv": "^4.3.3",
        "@icetee/ftp": "^1.0.3",
        "multer": "^1.4.1",
        "csv-parse": "^3.1.3",
        "node-7z": "^1.1.0"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/me/myrepo.git"
    },
    "license": "ISC",
    "main": "index.js",
    "files": [
        "index.js",
        "lib"
    ]
}

Do you have any idea what's wrong?

Update: My specs:

mylinuxuser:# node --version
v6.16.0
mylinuxuser:# npm --version
3.10.10
mylinuxuser:# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial
q2s2t commented 5 years ago

Yep, Version 6 of Node.js is outdated (see Node.js releases and #61 ). You need v8 at least. Note that the official way of installing Node.js is here https://github.com/nodesource/distributions/blob/master/README.md#deb Have fun!