title: Error: Unexpected end of JSON input in npm install after running jhipster command
body: <p>I have node v: 10.15.0, npm v: 6.4.11
  and I'm trying to install JHipster. the files generation worked fine but when it runs <code>npm install</code> I got this error:</p>
  
  <pre><code>npm ERR! Unexpected end of JSON input while parsing near '....0.2","null-loader":"'
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     C:\Users\chiheb\AppData\Roaming\npm-cache\_logs\2019-01-07T21_05_15_281Z-debug.log
  </code></pre>
  
  <p>this is the end of the log file:</p>
  
  <pre><code>2606 silly saveTree pharma-care@0.0.0
  2606 silly saveTree +-- @angular/common@7.1.0
  2606 silly saveTree | `-- tslib@1.9.3
  2606 silly saveTree +-- @angular/compiler@7.1.0
  2606 silly saveTree +-- @angular/core@7.1.0
  2606 silly saveTree +-- @angular/forms@7.1.0
  2606 silly saveTree +-- @angular/platform-browser-dynamic@7.1.0
  2606 silly saveTree +-- @angular/platform-browser@7.1.0
  2606 silly saveTree +-- @angular/router@7.1.0
  2606 silly saveTree +-- @fortawesome/angular-fontawesome@0.3.0
  2606 silly saveTree +-- @fortawesome/fontawesome-svg-core@1.2.8
  2606 silly saveTree +-- @fortawesome/free-solid-svg-icons@5.5.0
  2606 silly saveTree +-- @ng-bootstrap/ng-bootstrap@4.0.0
  2606 silly saveTree +-- bootstrap@4.1.3
  2606 silly saveTree +-- core-js@2.5.7
  2606 silly saveTree +-- moment@2.22.2
  2606 silly saveTree +-- ng-jhipster@0.5.6
  2606 silly saveTree +-- ngx-cookie@2.0.1
  2606 silly saveTree +-- ngx-infinite-scroll@6.0.1
  2606 silly saveTree +-- ngx-webstorage@2.0.1
  2606 silly saveTree +-- rxjs@6.3.3
  2606 silly saveTree +-- tslib@1.9.3
  2606 silly saveTree `-- zone.js@0.8.26
  2607 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '....0.2","null-loader":"'
  2607 verbose stack     at JSON.parse (&lt;anonymous&gt;)
  2607 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
  2607 verbose stack     at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
  2607 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)
  2608 verbose cwd E:\education\ENISo\IA3.2\ProjetSemestriel\PharmaCare
  2609 verbose Windows_NT 10.0.17134
  2610 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--cache-min" "86400"
  2611 verbose node v10.15.0
  2612 verbose npm  v6.4.1
  2613 error Unexpected end of JSON input while parsing near '....0.2","null-loader":"'
  2614 verbose exit [ 1, true ]
  </code></pre>
  
  <p>I think the problem is in the package.json file generated by Jhipster but I couldn't find the mistake in it.
  package.json:</p>
  
  <pre><code>{
  "name": "pharma-care",
  "version": "0.0.0",
  "description": "Description for PharmaCare",
  "private": true,
  "license": "UNLICENSED",
  "cacheDirectories": [
      "node_modules"
  ],
  "dependencies": {
      "@angular/common": "7.1.0",
      "@angular/compiler": "7.1.0",
      "@angular/core": "7.1.0",
      "@angular/forms": "7.1.0",
      "@angular/platform-browser": "7.1.0",
      "@angular/platform-browser-dynamic": "7.1.0",
      "@angular/router": "7.1.0",
      "@fortawesome/angular-fontawesome": "0.3.0",
      "@fortawesome/fontawesome-svg-core": "1.2.8",
      "@fortawesome/free-solid-svg-icons": "5.5.0",
      "@ng-bootstrap/ng-bootstrap": "4.0.0",
      "bootstrap": "4.1.3",
      "core-js": "2.5.7",
      "moment": "2.22.2",
      "ng-jhipster": "0.5.6",
      "ngx-cookie": "2.0.1",
      "ngx-infinite-scroll": "6.0.1",
      "ngx-webstorage": "2.0.1",
      "rxjs": "6.3.3",
      "swagger-ui": "2.2.10",
      "tslib": "1.9.3",
      "zone.js": "0.8.26"
  },
  "devDependencies": {
      "@angular/cli": "7.0.6",
      "@angular/compiler-cli": "7.1.0",
      "@ngtools/webpack": "7.0.6",
      "@types/jest": "23.3.9",
      "@types/node": "10.12.10",
      "angular-router-loader": "0.8.5",
      "angular2-template-loader": "0.6.2",
      "autoprefixer": "9.3.1",
      "browser-sync": "2.26.3",
      "browser-sync-webpack-plugin": "2.2.2",
      "cache-loader": "1.2.5",
      "codelyzer": "4.5.0",
      "copy-webpack-plugin": "4.6.0",
      "css-loader": "1.0.1",
      "file-loader": "2.0.0",
      "fork-ts-checker-webpack-plugin": "0.5.0",
      "friendly-errors-webpack-plugin": "1.7.0",
      "generator-jhipster": "5.7.2",
      "html-loader": "0.5.5",
      "html-webpack-plugin": "3.2.0",
      "husky": "1.2.0",
      "jest": "23.6.0",
      "jest-junit": "5.2.0",
      "jest-preset-angular": "6.0.1",
      "jest-sonar-reporter": "2.0.0",
      "lint-staged": "8.1.0",
      "mini-css-extract-plugin": "0.4.5",
      "moment-locales-webpack-plugin": "1.0.7",
      "optimize-css-assets-webpack-plugin": "5.0.1",
      "prettier": "1.15.2",
      "reflect-metadata": "0.1.12",
      "rimraf": "2.6.2",
      "simple-progress-webpack-plugin": "1.1.2",
      "style-loader": "0.23.1",
      "terser-webpack-plugin": "1.1.0",
      "thread-loader": "1.2.0",
      "to-string-loader": "1.1.5",
      "ts-loader": "5.3.0",
      "tslint": "5.11.0",
      "tslint-config-prettier": "1.16.0",
      "tslint-loader": "3.6.0",
      "typescript": "3.1.6",
      "postcss-loader": "3.0.0",
      "xml2js": "0.4.19",
      "webpack": "4.26.0",
      "webpack-cli": "3.1.2",
      "webpack-dev-server": "3.1.10",
      "webpack-merge": "4.1.4",
      "webpack-notifier": "1.7.0",
      "webpack-visualizer-plugin": "0.1.11",
      "workbox-webpack-plugin": "3.6.3",
      "write-file-webpack-plugin": "4.5.0"
  },
  "engines": {
      "node": "&gt;=8.9.0"
  },
  "lint-staged": {
      "{,src/**/}*.{md,json,ts,css,scss}": [
          "prettier --write",
          "git add"
      ]
  },
  "scripts": {
      "prettier:format": "prettier --write \"{,src/**/}*.{md,json,ts,css,scss}\"",
      "lint": "tslint --project tsconfig.json -e 'node_modules/**'",
      "lint:fix": "npm run lint -- --fix",
      "ngc": "ngc -p tsconfig-aot.json",
      "cleanup": "rimraf target/{aot,www}",
      "clean-www": "rimraf target//www/app/{src,target/}",
      "start": "npm run webpack:dev",
      "start-tls": "npm run webpack:dev -- --env.tls",
      "serve": "npm run start",
      "build": "npm run webpack:prod",
      "test": "npm run lint &amp;&amp; jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js",
      "test:watch": "npm run test -- --watch",
      "webpack:dev": "npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --hot --port=9060 --watch-content-base --env.stats=minimal",
      "webpack:dev-verbose": "npm run webpack-dev-server -- --config webpack/webpack.dev.js --inline --hot --port=9060 --watch-content-base --profile --progress --env.stats=normal",
      "webpack:build:main": "npm run webpack -- --config webpack/webpack.dev.js --env.stats=minimal",
      "webpack:build": "npm run cleanup &amp;&amp; npm run webpack:build:main",
      "webpack:prod:main": "npm run webpack -- --config webpack/webpack.prod.js --profile",
      "webpack:prod": "npm run cleanup &amp;&amp; npm run webpack:prod:main &amp;&amp; npm run clean-www",
      "webpack:test": "npm run test",
      "webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
      "webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"
  },
  "jestSonar": {
      "reportPath": "target/test-results/jest",
      "reportFile": "TESTS-results-sonar.xml"
  }
  }
  </code></pre>
  
  <p>so I hope that you find a solution to this problem because it took me so long to open this question.</p>