1
votes

I have a Node project, a backend using Loopback 4, freshly downloaded From GitLab npm install ok npm build ok npm start fails

The problem is the following

node -r source-map-support/register .

<function>:75
    static(path, rootDir, options) {
          ^

SyntaxError: Expected ident but found (
    at Module._compile (internal/modules/cjs/loader.js:895:18)
    at Object..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/Users/laurent/tmp2/privback/node_modules/@loopback/rest/src/index.ts:15:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)

In the trace it appears it come from loopback/rest export * from application It seems it comes from the application code

The same project in another folder has no problem.

npm version 6.13.14 node version 12.14.0

package.json (dependencies) "@loopback/authentication": "^3.3.0", "@loopback/boot": "^1.7.1", "@loopback/context": "^1.25.1", "@loopback/core": "^1.12.1", "@loopback/openapi-v3": "^1.11.0", "@loopback/repository": "^1.17.0", "@loopback/rest": "^1.25.1", "@loopback/rest-explorer": "^1.4.7", "@loopback/service-proxy": "^1.3.14", "@types/bcryptjs": "^2.4.2", "@types/lodash": "^4.14.149", "@types/neo4j": "^2.0.2", "bcryptjs": "^2.4.3", "dotenv": "^8.2.0", "dotenv-extended": "^2.5.0", "jsonwebtoken": "^8.5.1", "ldapjs": "^1.0.2", "lodash": "^4.17.15", "loopback-connector-neo4j": "^0.1.3", "loopback-connector-neo4j-bolt": "lsocrate/loopback-connector-neo4j-bolt#master", "loopback-connector-neo4j-cypher": "0.0.7", "loopback-context": "^3.4.0", "streamline": "^3.0.0", "streamline-runtime": "^2.0.0"

(devDependencies) "@loopback/build": "^3.0.1", "@loopback/eslint-config": "^5.0.1", "@loopback/testlab": "^1.10.1", "@types/node": "^10.17.13", "@typescript-eslint/eslint-plugin": "^2.15.0", "@typescript-eslint/parser": "^2.15.0", "eslint": "^6.8.0", "eslint-config-prettier": "^6.9.0", "eslint-plugin-eslint-plugin": "^2.1.0", "eslint-plugin-mocha": "^6.2.2", "mocha": "^7.0.0", "source-map-support": "^0.5.16", "streamline-typings": "^1.0.1", "typescript": "^3.7.5"

1

1 Answers

2
votes

the problem didn't come from application... I had to applications downloaded From GitLab with exactly the same source code

In fact it came from the module fibers. Compiled with a different version of Node.js I did a npm rebuild Then npm start Everything OK now