Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

for await (const part of multipart(request)) {} : Unexpected reserved word #2598

Closed
Thisisjuke opened this issue Nov 12, 2019 · 4 comments
Closed

Comments

@Thisisjuke
Copy link

Type: Bug

Severity: Critical - System crash, application panic.

Description:

Nothing except 'yarn add ipfs', then when launching my docker.
I've got this error :

 (node:77) UnhandledPromiseRejectionWarning: /home/node/app/node_modules/ipfs/src/http/api/resources/object.js:132
     for await (const part of multipart(request)) {
        ^^^^^

SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Module._compile (/home/node/app/node_modules/pirates/lib/index.js:99:24)
     at Module._extensions..js (module.js:664:10)
    at Object.newLoader [as .js] (/home/node/app/node_modules/pirates/lib/index.js:104:7)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)

Steps to reproduce the error:

Package JSON :

{
  "name": "node-front",
  "version": "0.0.1",
  "description": "node front",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "jest"
  },
  "type": "module",
  "license": "ISC",
  "dependencies": {
    "boom": "^7.3.0",
    "hapi": "^18.1.0",
    "hapi-router": "^4.0.0", Unexpected reserved word
    "ipfs": "^0.39.0", Unexpected reserved word Unexpected reserved word
    "nodemon": "^1.18.11",
    "uuid": "^3.3.3",
    "videostream": "^3.2.1"
  },
  "devDependencies": {
    "@babel/cli": "^7.2.3",
    "@babel/core": "^7.4.0",
    "@babel/node": "^7.6.3",
    "@babel/polyfill": "^7.6.0",
    "@babel/preset-env": "^7.4.2",
    "@babel/register": "^7.4.0",
    "babel-plugin-module-resolver": "^3.2.0",
    "jest": "^24.8.0"
  }
}

Tried to launch without babel, without nodemon, always the same error. I tried some examples repos, that works.

@achingbrain
Copy link
Member

Which version of node are you running? You may need to upgrade.

@Thisisjuke
Copy link
Author

My docker-compose uses : image: "node:8"

@achingbrain
Copy link
Member

Please try with Node 10 or above, preferably 12 as it's the LTS version.

@Thisisjuke
Copy link
Author

Working with Node 12 after updating some dependencies. Thx!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants