Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript npm错误!过早关闭_Javascript_Node.js_Reactjs_Npm - Fatal编程技术网

Javascript npm错误!过早关闭

Javascript npm错误!过早关闭,javascript,node.js,reactjs,npm,Javascript,Node.js,Reactjs,Npm,我购买并使用ReactJS模板 我想在模板的根目录中使用npm install安装所有依赖项(React App) 但是我得到了一个类似这样的错误: 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, upgr

我购买并使用ReactJS模板

我想在模板的根目录中使用
npm install
安装所有依赖项(React App)

但是我得到了一个类似这样的错误:

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


我对ReactJS还是新手,
我希望你能帮助我,

谢谢。

当您的依赖项中列出了一个库,但由于某种原因它实际上并不存在时,就会发生此错误


类似帖子:

如果库具有无效的package.json文件,则可能发生这种情况。在我的例子中,库(我自己的)有一个非法版本号。

项目根目录中的
node\u modules
文件夹中是否填充了它可以安装的软件包?此外,错误中的包看起来不像您发布的
package.json
中列出的包,您是否正在从正确的文件夹执行npm安装?请将npm日志文件的相关内容
C:\Users\User\AppData\Roaming\npm cache\\ u logs\2020-01-10T19_36_35_673Z-debug.log
放在问题中是的,我已在正确的文件夹@jdunken中运行了该命令。您的意思是什么相关内容?我不理解@AritraChakrabortyokay,然后将整个内容放在这里,或者将其上传到某个地方并链接到这里。我也遇到过这样的情况,有人签入了一个package.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"
  },
...