最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - npm ERR! premature close - Stack Overflow

programmeradmin1浏览0评论

I buy and use a ReactJS template. this is the template that I use

I wanna install All dependencies using npm install in root directory of Templates(React-App)

but i got an ERROR like this:

c:\Dev\template>npm install
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not remended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: No longer maintained, see more info in readme
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not remended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not remended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm ERR! premature close

npm ERR! A plete 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

After an ERROR I installed these packages(npm install react-script and --save core-js@^3).

and after I try again I still get the same ERROR


here's dependencies in my 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": ".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": ".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+.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"
  },
...



I am still new to ReactJS,
I hope you can help me,
thanks.

I buy and use a ReactJS template. this is the template that I use

I wanna install All dependencies using npm install in root directory of Templates(React-App)

but i got an ERROR like this:

c:\Dev\template>npm install
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not remended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: No longer maintained, see more info in readme
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not remended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not remended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm ERR! premature close

npm ERR! A plete 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

After an ERROR I installed these packages(npm install react-script and --save core-js@^3).

and after I try again I still get the same ERROR


here's dependencies in my 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./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./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./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"
  },
...



I am still new to ReactJS,
I hope you can help me,
thanks.

Share asked Jan 10, 2020 at 20:08 KevinKevin 4439 silver badges22 bronze badges 5
  • Is the node_modules folder in the root of your project being populated with the packages it can install? Also the packages in your error don't look like they are listed in the package.json you posted, are you executing npm install from the correct folder? – JDunken Commented Jan 10, 2020 at 20:13
  • 3 Please put the relevant content of the npm log file C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-01-10T19_36_35_673Z-debug.log here in the question – Aritra Chakraborty Commented Jan 10, 2020 at 20:19
  • yes I have run the mand in the correct folder @JDunken – Kevin Commented Jan 11, 2020 at 3:15
  • What relavant content do you mean? I do not understand @AritraChakraborty – Kevin Commented Jan 11, 2020 at 3:17
  • okay then put the entire thing here, either in the question or upload it somewhere and link it here. – Aritra Chakraborty Commented Jan 11, 2020 at 9:29
Add a ment  | 

2 Answers 2

Reset to default 5

This can happen if a library has an invalid package.json file. In my case, the library (my own) had an illegal version number.

This error occurs when you have a library listed as your dependency but it does not actually exist due to some reason.

Similar post: Link

发布评论

评论列表(0)

  1. 暂无评论