Search code examples
javascripttypescriptnpmlerna

Error while compiling the project with npm


I am trying to get a project running and when I execute the npm install it installs all the dependencies. But after that I try to execute npm run compile and it gives me an error.

Here is the log file for better understanding the error.

0 info it worked if it ends with ok
1 verbose cli [ '/Users/roxhens/.nvm/versions/node/v10.13.0/bin/node',
1 verbose cli   '/Users/roxhens/.nvm/versions/node/v10.13.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@6.4.1
3 info using node@v10.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle jsonforms-tooling-common@0.0.1~prebuild: jsonforms-tooling-common@0.0.1
6 info lifecycle jsonforms-tooling-common@0.0.1~build: jsonforms-tooling-common@0.0.1
7 verbose lifecycle jsonforms-tooling-common@0.0.1~build: unsafe-perm in lifecycle true
8 verbose lifecycle jsonforms-tooling-common@0.0.1~build: PATH: /Users/roxhens/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common/node_modules/.bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common/node_modules/.bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/node_modules/.bin:/Users/roxhens/Desktop/GitHub/node_modules/.bin:/Users/roxhens/Desktop/node_modules/.bin:/Users/roxhens/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/Users/roxhens/.nvm/versions/node/v10.13.0/bin:/Users/roxhens/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/roxhens/Desktop/GitHub/jsonforms-tooling/node_modules/.bin:/Users/roxhens/.nvm/versions/node/v10.13.0/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin
9 verbose lifecycle jsonforms-tooling-common@0.0.1~build: CWD: /Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common
10 silly lifecycle jsonforms-tooling-common@0.0.1~build: Args: [ '-c', 'npm run compile' ]
11 silly lifecycle jsonforms-tooling-common@0.0.1~build: Returned: code: 2  signal: null
12 info lifecycle jsonforms-tooling-common@0.0.1~build: Failed to exec build script
13 verbose stack Error: jsonforms-tooling-common@0.0.1 build: `npm run compile`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/Users/roxhens/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/Users/roxhens/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid jsonforms-tooling-common@0.0.1
15 verbose cwd /Users/roxhens/Desktop/GitHub/jsonforms-tooling/jsonforms-tooling-common
16 verbose Darwin 18.2.0
17 verbose argv "/Users/roxhens/.nvm/versions/node/v10.13.0/bin/node" "/Users/roxhens/.nvm/versions/node/v10.13.0/bin/npm" "run" "build"
18 verbose node v10.13.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error jsonforms-tooling-common@0.0.1 build: `npm run compile`
22 error Exit status 2
23 error Failed at the jsonforms-tooling-common@0.0.1 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

This is the package.json in the project root directory.

{
  "scripts": {
    "lerna": "lerna",
    "coveralls": "ts-jest --coverage && cat ./tests/coverage/lcov.info | coveralls",
    "postinstall": "npm run lernabootstrap && npm run lernainstall",
    "lernainstall": "lerna exec --no-bail --npm-ci-mode -- npm run custominstall",
    "lernabootstrap": "lerna bootstrap --npm-ci-mode --ignore-scripts",
    "compile": "lerna run build",
    "lint": "lerna run lint"
  },
  "devDependencies": {
    "@types/jest": "^23.3.11",
    "@types/node": "^10.12.10",
    "coveralls": "^3.0.2",
    "jest": "^23.6.0",
    "lerna": "^3.4.3",
    "rimraf": "2.6.3",
    "ts-jest": "^23.10.4",
    "tslint": "^5.11.0",
    "tslint-react": "^3.6.0",
    "typescript": "^3.1.6",
    "vscode": "^1.1.21"
  },
  "dependencies": {
    "@jsonforms/core": "^2.0.12",
    "simple-git": "^1.107.0"
  }
}

Solution

  • I still cannot find the reason why that error, but I managed to fix it by deleting the files and cloning the repository again.