javascript - Boilerplate Github存储库将无法运行npm install,ERR!在 '…compile-2.0.0-beta.4.t'附近进行解析时,JSON输入意外结束

标签 javascript node.js npm electron

我正在遵循并在教程书中构建应用程序,这是仓库的链接https://github.com/electron-in-action/jetsetter似乎在我运行'npm install'时未安装依赖程序。

在工作目录中运行npm install之前,我尝试使用-g标记安装一些依赖项,但这并没有改变任何内容,我仍然遇到相同的错误。

CLI上的错误消息是:

ERR! Unexpected end of JSON input while parsing near '...ompile-2.0.0-beta.4.t'

我不确定尾随的... ompile是否指 Electron 编译,因为在项目的序言中提到过它,但是我确实在运行前在全局范围内安装了它
npm install.

这是日志文件的最后几行:
806 silly pacote range manifest for mime-types@^2.1.12 fetched in 98ms
807 silly pacote range manifest for camelcase-keys@^2.0.0 fetched in 766ms
808 http fetch GET 304 https://registry.npmjs.org/decamelize 786ms (from cache)
809 http fetch GET 304 https://registry.npmjs.org/loud-rejection 752ms (from cache)
810 silly pacote range manifest for loud-rejection@^1.0.0 fetched in 801ms
811 silly pacote range manifest for decamelize@^1.1.2 fetched in 851ms
812 http fetch GET 304 https://registry.npmjs.org/map-obj 677ms (from cache)
813 silly pacote range manifest for ajv@^6.5.5 fetched in 13ms
814 http fetch GET 304 https://registry.npmjs.org/redent 623ms (from cache)
815 http fetch GET 304 https://registry.npmjs.org/trim-newlines 633ms (from cache)
816 silly pacote range manifest for map-obj@^1.0.1 fetched in 713ms
817 silly pacote range manifest for redent@^1.0.0 fetched in 693ms
818 silly pacote range manifest for trim-newlines@^1.0.0 fetched in 703ms
819 silly pacote range manifest for punycode@^1.4.1 fetched in 54ms
820 http fetch GET 200 https://registry.npmjs.org/assert-plus 560ms
821 http fetch GET 304 https://registry.npmjs.org/delayed-stream 832ms (from cache)
822 http fetch GET 304 https://registry.npmjs.org/asynckit 741ms (from cache)
823 silly pacote range manifest for assert-plus@^1.0.0 fetched in 625ms
824 silly pacote range manifest for delayed-stream@~1.0.0 fetched in 863ms
825 silly pacote range manifest for safe-buffer@^5.0.1 fetched in 4ms
826 silly pacote range manifest for asynckit@^0.4.0 fetched in 799ms
827 silly pacote range manifest for is-fullwidth-code-point@^1.0.0 fetched in 49ms
828 http fetch GET 200 https://registry.npmjs.org/jsprim 574ms
829 silly pacote range manifest for jsprim@^1.2.2 fetched in 634ms
830 http fetch GET 304 https://registry.npmjs.org/har-schema 606ms (from cache)
831 http fetch GET 304 https://registry.npmjs.org/speedometer 1889ms (from cache)
832 http fetch GET 304 https://registry.npmjs.org/psl 607ms (from cache)
833 http fetch GET 304 https://registry.npmjs.org/code-point-at 502ms (from cache)
834 silly pacote range manifest for speedometer@~0.1.2 fetched in 1933ms
835 silly pacote range manifest for har-schema@^2.0.0 fetched in 683ms
836 silly pacote range manifest for code-point-at@^1.0.0 fetched in 664ms
837 silly pacote range manifest for psl@^1.1.24 fetched in 782ms
838 silly pacote range manifest for find-up@^1.0.0 fetched in 158ms
839 http fetch GET 200 https://registry.npmjs.org/sshpk 850ms
840 silly pacote range manifest for read-pkg@^1.0.0 fetched in 143ms
841 silly pacote range manifest for map-obj@^1.0.0 fetched in 34ms
842 silly pacote range manifest for signal-exit@^3.0.0 fetched in 45ms
843 silly pacote range manifest for sshpk@^1.7.0 fetched in 915ms
844 http fetch GET 304 https://registry.npmjs.org/p-try 610ms (from cache)
845 http fetch GET 304 https://registry.npmjs.org/is-arrayish 621ms (from cache)
846 http fetch GET 304 https://registry.npmjs.org/spdx-exceptions 556ms (from cache)
847 http fetch GET 304 https://registry.npmjs.org/spdx-license-ids 659ms (from cache)
848 http fetch GET 304 https://registry.npmjs.org/mime-db 985ms (from cache)
849 silly pacote range manifest for is-arrayish@^0.2.1 fetched in 732ms
850 silly pacote range manifest for p-try@^1.0.0 fetched in 735ms
851 silly pacote range manifest for spdx-license-ids@^3.0.0 fetched in 827ms
852 silly pacote version manifest for mime-db@1.42.0 fetched in 1070ms
853 silly pacote version manifest for assert-plus@1.0.0 fetched in 161ms
854 silly pacote range manifest for spdx-exceptions@^2.1.0 fetched in 868ms
855 silly pacote range manifest for path-exists@^2.0.0 fetched in 20ms
856 silly pacote range manifest for load-json-file@^1.0.0 fetched in 95ms
857 silly pacote range manifest for path-type@^1.0.0 fetched in 111ms
858 http fetch GET 304 https://registry.npmjs.org/currently-unhandled 766ms (from cache)
859 http fetch GET 304 https://registry.npmjs.org/camelcase 819ms (from cache)
860 http fetch GET 304 https://registry.npmjs.org/indent-string 816ms (from cache)
861 silly pacote range manifest for currently-unhandled@^0.4.1 fetched in 838ms
862 silly pacote range manifest for camelcase@^2.0.0 fetched in 930ms
863 silly pacote range manifest for safer-buffer@^2.0.2 fetched in 21ms
864 http fetch GET 304 https://registry.npmjs.org/strip-indent 887ms (from cache)
865 http fetch GET 304 https://registry.npmjs.org/number-is-nan 906ms (from cache)
866 http fetch GET 200 https://registry.npmjs.org/extsprintf 713ms
867 silly pacote range manifest for strip-indent@^1.0.1 fetched in 929ms
868 silly pacote range manifest for indent-string@^2.1.0 fetched in 1007ms
869 http fetch GET 200 https://registry.npmjs.org/verror 698ms
870 silly pacote version manifest for extsprintf@1.3.0 fetched in 766ms
871 http fetch GET 304 https://registry.npmjs.org/json-schema 719ms (from cache)
872 silly pacote range manifest for number-is-nan@^1.0.0 fetched in 1043ms
873 silly pacote version manifest for verror@1.10.0 fetched in 776ms
874 silly pacote version manifest for json-schema@0.2.3 fetched in 796ms
875 silly pacote range manifest for strip-bom@^2.0.0 fetched in 126ms
876 http fetch GET 304 https://registry.npmjs.org/dashdash 709ms (from cache)
877 http fetch GET 200 https://registry.npmjs.org/asn1 751ms
878 silly pacote version manifest for core-util-is@1.0.2 fetched in 103ms
879 http fetch GET 200 https://registry.npmjs.org/getpass 546ms
880 silly pacote range manifest for extsprintf@^1.2.0 fetched in 57ms
881 silly pacote range manifest for asn1@~0.2.3 fetched in 832ms
882 silly pacote range manifest for dashdash@^1.12.0 fetched in 821ms
883 silly pacote range manifest for safer-buffer@~2.1.0 fetched in 37ms
884 silly pacote range manifest for getpass@^0.1.1 fetched in 603ms
885 http fetch GET 200 https://registry.npmjs.org/bcrypt-pbkdf 415ms
886 silly pacote range manifest for bcrypt-pbkdf@^1.0.0 fetched in 473ms
887 http fetch GET 304 https://registry.npmjs.org/jsbn 608ms (from cache)
888 http fetch GET 304 https://registry.npmjs.org/ecc-jsbn 547ms (from cache)
889 silly pacote range manifest for jsbn@~0.1.0 fetched in 653ms
890 http fetch GET 304 https://registry.npmjs.org/tweetnacl 598ms (from cache)
891 http fetch GET 304 https://registry.npmjs.org/repeating 471ms (from cache)
892 silly pacote range manifest for ecc-jsbn@~0.1.1 fetched in 571ms
893 silly pacote range manifest for safer-buffer@^2.1.0 fetched in 2ms
894 silly pacote range manifest for repeating@^2.0.0 fetched in 499ms
895 silly pacote range manifest for tweetnacl@~0.14.0 fetched in 658ms
896 http fetch GET 304 https://registry.npmjs.org/array-find-index 587ms (from cache)
897 http fetch GET 304 https://registry.npmjs.org/is-utf8 335ms (from cache)
898 http fetch GET 304 https://registry.npmjs.org/tweetnacl 226ms (from cache)
899 silly pacote range manifest for tweetnacl@^0.14.3 fetched in 230ms
900 silly pacote range manifest for array-find-index@^1.0.1 fetched in 648ms
901 silly pacote range manifest for is-utf8@^0.2.0 fetched in 395ms
902 http fetch GET 304 https://registry.npmjs.org/is-finite 464ms (from cache)
903 silly pacote range manifest for is-finite@^1.0.0 fetched in 500ms
904 silly pacote version manifest for electron@1.7.11 fetched in 19ms
905 silly resolveWithNewModule electron@1.7.11 checking installable status
906 silly pacote version manifest for prop-types@15.6.0 fetched in 27ms
907 silly resolveWithNewModule prop-types@15.6.0 checking installable status
908 silly pacote version manifest for react@16.2.0 fetched in 29ms
909 silly resolveWithNewModule react@16.2.0 checking installable status
910 silly pacote version manifest for react-dom@16.2.0 fetched in 31ms
911 silly resolveWithNewModule react-dom@16.2.0 checking installable status
912 http fetch GET 200 https://registry.npmjs.org/electron-prebuilt-compile 38ms (from cache)
913 silly fetchPackageMetaData error for electron-prebuilt-compile@1.7.11 Unexpected end of JSON input while parsing near '...ompile-2.0.0-beta.4.t'
914 timing stage:rollbackFailedOptional Completed in 1ms
915 timing stage:runTopLevelLifecycles Completed in 36778ms
916 silly saveTree jetsetter@1.0.0
916 silly saveTree +-- electron@1.7.11
916 silly saveTree +-- prop-types@15.6.0
916 silly saveTree +-- react-dom@16.2.0
916 silly saveTree `-- react@16.2.0
917 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ompile-2.0.0-beta.4.t'
917 verbose stack     at JSON.parse (<anonymous>)
917 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
917 verbose stack     at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
917 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)
918 verbose cwd C:\Users\Nemi\electronPractice\jetsetter\jetsetter
919 verbose Windows_NT 10.0.18362
920 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
921 verbose node v10.16.0
922 verbose npm  v6.9.0
923 error Unexpected end of JSON input while parsing near '...ompile-2.0.0-beta.4.t'
924 verbose exit [ 1, true ]

最佳答案

我将Package.json中的版本更改为“1.x”等,该版本非常具体,我认为该仓库可能已经有一段时间没有更新了。

关于javascript - Boilerplate Github存储库将无法运行npm install,ERR!在 '…compile-2.0.0-beta.4.t'附近进行解析时,JSON输入意外结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59318750/

相关文章:

node.js - 使用 或 过滤关键字

javascript - 对 Javascript 对象中的值进行排名

javascript - 启用虚拟化时选择剑道网格中的行

javascript - ReactJS 文件夹结构

node.js - 如何重新启动/更新 Node Express 虚拟主机站点

node.js - 有 Uglify Express 中间件吗?

node.js - npx 每次都需要重新安装软件包

javascript - 我如何使此代码每5分钟自动运行一次,以使即使关闭计算机电源,视频标题也与 View 匹配?

Node.js:如何将 Mongoose 结果传递给我的 socket.emit

sqlite - 将 npm 模块与 Electron 和 webpack 一起使用?