簡體   English   中英

npm 錯誤! 過早關閉

[英]npm ERR! premature close

我購買並使用 ReactJS 模板。 這是我使用的模板

我想在 Templates(React-App) 的根目錄中使用npm install安裝所有依賴項

但我收到了這樣的錯誤

c:\Dev\template>npm install
npm WARN deprecated core-js@2.5.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated react-s-alert@1.4.1: No longer maintained, see more info in readme
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm ERR! premature close

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-01-10T19_36_35_673Z-debug.log

出現錯誤后,我安裝了這些軟件包( npm install react-script--save core-js@^3 )。

在我再次嘗試后,我仍然收到相同的錯誤


這是我的packages.json 中的依賴項:

...
  "dependencies": {
    "@amcharts/amcharts4": "^4.7.1",
    "@amcharts/amcharts4-geodata": "^4.1.7",
    "@fullcalendar/core": "^4.3.1",
    "@fullcalendar/daygrid": "^4.3.0",
    "@fullcalendar/interaction": "^4.3.0",
    "@fullcalendar/react": "^4.3.0",
    "@fullcalendar/timegrid": "^4.3.0",
    "animate.css": "3.7.0",
    "apexcharts": "^3.10.0",
    "awesome-bootstrap-checkbox": "1.0.1",
    "axios": "^0.18.0",
    "bootstrap": "4.0.0",
    "bootstrap_calendar": "https://github.com/xero/bootstrap_calendar.git#1.0.1",
    "classnames": "^2.2.6",
    "core-js": "^3.6.2",
    "draft-js": "^0.10.5",
    "echarts": "^4.4.0",
    "echarts-for-react": "^2.0.15-beta.1",
    "flot": "^0.8.0-alpha",
    "flot.dashes": "https://github.com/cquartier/flot.dashes.git",
    "font-awesome": "4.7.0",
    "formsy-react": "0.19.5",
    "glyphicons-halflings": "^1.9.1",
    "highcharts": "^7.2.0",
    "highcharts-react-official": "^2.2.2",
    "jasny-bootstrap": "^3.1.3",
    "jsonwebtoken": "^8.5.1",
    "line-awesome": "github:icons8/line-awesome",
    "messenger": "git+https://github.com/HubSpot/messenger.git#v1.4.2",
    "moment": "^2.22.2",
    "nvd3": "1.8.6",
    "rc-color-picker": "^1.2.6",
    "rc-hammerjs": "0.6.9",
    "rc-slider": "^8.7.1",
    "react": "^16.5.2",
    "react-animate-height": "^2.0.15",
    "react-animated-number": "^0.4.4",
    "react-apexcharts": "^1.3.3",
    "react-app-polyfill": "^0.1.3",
    "react-autosize-textarea": "^5.0.0",
    "react-bootstrap-table": "4.1.5",
    "react-bootstrap-table-next": "^3.0.0",
    "react-bootstrap-table2-paginator": "^2.0.3",
    "react-bootstrap-table2-toolkit": "^1.3.1",
    "react-datetime": "^2.16.1",
    "react-dev-utils": "^6.0.5",
    "react-dnd": "^7.3.1",
    "react-dom": "^16.5.2",
    "react-draft-wysiwyg": "1.10.12",
    "react-dropzone": "^6.2.4",
    "react-google-maps": "^9.4.5",
    "react-grid-layout": "^0.16.6",
    "react-images": "^0.5.19",
    "react-maskedinput": "^4.0.1",
    "react-mde": "2.3.4",
    "react-redux": "^5.0.7",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-router-hash-link": "^1.2.1",
    "react-script": "^2.0.5",
    "react-scrollspy": "^3.3.5",
    "react-select": "^3.0.8",
    "react-shuffle": "2.1.0",
    "react-slick": "^0.23.1",
    "react-sortable-hoc": "^1.10.1",
    "react-sortable-tree": "^2.2.0",
    "react-sortablejs": "1.5.0",
    "react-sparklines": "^1.7.0",
    "react-syntax-highlighter": "^10.1.2",
    "react-table": "6.7.6",
    "react-tagsinput": "^3.19.0",
    "react-toastify": "^5.4.0",
    "react-transition-group": "^2.5.2",
    "react-trend": "^1.2.5",
    "reactstrap": "7.1.0",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "rickshaw": "1.6.6",
    "showdown": "1.8.6",
    "skycons": "^1.0.0",
    "sortablejs": "1.10.0",
    "uuid": "^3.3.3"
  },
  "devDependencies": {
    "@babel/core": "7.4.4",
    "@babel/plugin-proposal-class-properties": "7.4.4",
    "@babel/plugin-proposal-optional-chaining": "^7.2.0",
    "@svgr/webpack": "4.2.0",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "10.0.1",
    "babel-jest": "24.8.0",
    "babel-loader": "8.0.5",
    "babel-plugin-named-asset-import": "1.0.0-next.103",
    "babel-preset-react-app": "9.0.0",
    "bfj": "6.1.1",
    "bundle-loader": "0.5.6",
    "case-sensitive-paths-webpack-plugin": "2.2.0",
    "chalk": "2.4.2",
    "css-loader": "2.1.1",
    "dotenv": "8.0.0",
    "dotenv-expand": "5.1.0",
    "eslint": "5.16.0",
    "eslint-config-react-app": "4.0.1",
    "eslint-loader": "2.1.1",
    "eslint-plugin-flowtype": "3.8.1",
    "eslint-plugin-import": "2.17.2",
    "eslint-plugin-jsx-a11y": "6.2.1",
    "eslint-plugin-react": "7.13.0",
    "eslint-plugin-react-hooks": "1.6.0",
    "expose-loader": "0.7.5",
    "file-loader": "3.0.1",
    "fs-extra": "7.0.1",
    "html-webpack-plugin": "4.0.0-alpha.2",
    "identity-obj-proxy": "3.0.0",
    "imports-loader": "0.8.0",
    "jest": "24.8.0",
    "jest-pnp-resolver": "1.2.1",
    "jest-resolve": "24.8.0",
    "lodash.assign": "^4.2.0",
    "lodash.clonedeep": "^4.5.0",
    "mini-css-extract-plugin": "0.6.0",
    "node-sass": "4.12.0",
    "optimize-css-assets-webpack-plugin": "5.0.1",
    "pnp-webpack-plugin": "1.4.3",
    "postcss-flexbugs-fixes": "4.1.0",
    "postcss-loader": "3.0.0",
    "postcss-preset-env": "6.6.0",
    "postcss-safe-parser": "4.0.1",
    "resolve": "1.10.1",
    "sass-loader": "7.1.0",
    "style-loader": "0.23.0",
    "terser-webpack-plugin": "1.2.3",
    "url-loader": "1.1.2",
    "webpack": "4.31.0",
    "webpack-dev-server": "3.3.1",
    "webpack-manifest-plugin": "2.0.4",
    "webpack-raphael": "2.1.4",
    "workbox-webpack-plugin": "4.3.1"
  },
...



我還是 ReactJS 的新手,
我希望你可以幫助我,
謝謝。

如果庫具有無效的 package.json 文件,就會發生這種情況。 就我而言,圖書館(我自己的)有一個非法的版本號。

當您將一個庫列為您的依賴項但由於某種原因它實際上並不存在時,就會發生此錯誤。

類似帖子: 鏈接

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM