解析'... est',“ gulp-insert”:“ l”附近时,JSON输入意外结束

时间:2019-05-21 21:50:10

标签: angular npm

这是我尝试过的:

  
      
  • 删除%AppData%/ npm
  •   
  • 清理npm缓存
  •   
  • 重新安装角度(npm install -g @ angular / cli @ latest)
  •   
  • 设置注册表(npm配置设置注册表“ https://registry.npmjs.com/”)
  •   
  • 以管理员身份一次又一次地尝试所有先前的步骤
  •   

最奇怪的是,几个小时前,我能够成功使用npm安装react-create工具。

完整的错误日志

456 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...3.X","@types/gulp-con'
456 verbose stack     at JSON.parse (<anonymous>)
456 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
456 verbose stack     at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
456 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)
457 verbose cwd C:\_d\WSs\angular
458 verbose Windows_NT 10.0.17763
459 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli@latest"
460 verbose node v10.15.3
461 verbose npm  v6.4.1
462 error Unexpected end of JSON input while parsing near '...3.X","@types/gulp-con'
463 verbose exit [ 1, true ]

***已编辑

我认真遵循了How to completely remove node.js from Windows中发现的所有步骤,包括重新启动PC

我再次安装了node和angular cli。尝试最简单的使用时,我仍然收到类似的错误。请参阅此处所有日志。 PS。我以管理员身份运行

Microsoft Windows [versão 10.0.17763.503]
(c) 2018 Microsoft Corporation. Todos os direitos reservados.

C:\Windows\system32>npm install -g @angular/cli@latest
C:\Users\jimis\AppData\Roaming\npm\ng -> C:\Users\jimis\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\@angular\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @angular/cli@7.3.9
added 295 packages from 180 contributors in 46.07s

C:\Windows\system32>cd C:\_d\WSs\angular

C:\_d\WSs\angular>ng new
? What name would you like to use for the new workspace and initial project? loans-angular
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
CREATE loans-angular/angular.json (3870 bytes)
CREATE loans-angular/package.json (1312 bytes)
CREATE loans-angular/README.md (1029 bytes)
CREATE loans-angular/tsconfig.json (435 bytes)
CREATE loans-angular/tslint.json (1621 bytes)
CREATE loans-angular/.editorconfig (246 bytes)
CREATE loans-angular/.gitignore (629 bytes)
CREATE loans-angular/src/favicon.ico (5430 bytes)
CREATE loans-angular/src/index.html (299 bytes)
CREATE loans-angular/src/main.ts (372 bytes)
CREATE loans-angular/src/polyfills.ts (2841 bytes)
CREATE loans-angular/src/styles.css (80 bytes)
CREATE loans-angular/src/test.ts (642 bytes)
CREATE loans-angular/src/browserslist (388 bytes)
CREATE loans-angular/src/karma.conf.js (1026 bytes)
CREATE loans-angular/src/tsconfig.app.json (166 bytes)
CREATE loans-angular/src/tsconfig.spec.json (256 bytes)
CREATE loans-angular/src/tslint.json (244 bytes)
CREATE loans-angular/src/assets/.gitkeep (0 bytes)
CREATE loans-angular/src/environments/environment.prod.ts (51 bytes)
CREATE loans-angular/src/environments/environment.ts (662 bytes)
CREATE loans-angular/src/app/app-routing.module.ts (245 bytes)
CREATE loans-angular/src/app/app.module.ts (393 bytes)
CREATE loans-angular/src/app/app.component.html (1152 bytes)
CREATE loans-angular/src/app/app.component.spec.ts (1116 bytes)
CREATE loans-angular/src/app/app.component.ts (217 bytes)
CREATE loans-angular/src/app/app.component.css (0 bytes)
CREATE loans-angular/e2e/protractor.conf.js (752 bytes)
CREATE loans-angular/e2e/tsconfig.e2e.json (213 bytes)
CREATE loans-angular/e2e/src/app.e2e-spec.ts (642 bytes)
CREATE loans-angular/e2e/src/app.po.ts (251 bytes)
npm ERR! Unexpected end of JSON input while parsing near '...","async":"0.2.x","en'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jimis\AppData\Roaming\npm-cache\_logs\2019-05-22T15_06_23_035Z-debug.log
Package install failed, see above.

0 个答案:

没有答案