1

Previously I was using webpack3 & works smoothly but after upgrade webpack5 and dependencies, now every first time --force is required for npm install (after removing node_modules directory). Need help to run and build without --force for npm install (first time), can anyone explain to fix this issue?

My environment: node --version: v14.15.1 and npm --version: 7.11.1

Project package.json below:

{
  "name": "my-project",
  "version": "1.0.0",
  "description": "Project description",
  "main": "index.js",
  "scripts": {
    "start": "cross-env NODE_ENV=development webpack serve --config build-utils/webpack.dev.js",
    "build": "cross-env NODE_ENV=production webpack --config build-utils/webpack.prod.js",
    "lint": "eslint src --ext .jsx --ext .js",
    "predeploy": "npm run build"
  },
  "keywords": [],
  "author": "Suzon",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.12.1",
    "@babel/plugin-proposal-class-properties": "^7.13.0",
    "@babel/plugin-proposal-decorators": "^7.13.5",
    "@babel/plugin-transform-react-jsx-source": "^7.12.13",
    "@babel/polyfill": "^7.12.1",
    "@babel/preset-env": "^7.12.1",
    "@babel/preset-react": "^7.12.1",
    "babel-eslint": "^10.1.0",
    "babel-loader": "^8.1.0",
    "buffer": "^6.0.3",
    "clean-webpack-plugin": "^3.0.0",
    "compression-webpack-plugin": "^7.1.2",
    "copy-webpack-plugin": "^6.2.1",
    "cross-env": "^7.0.2",
    "css-loader": "^5.0.0",
    "css-minimizer-webpack-plugin": "^1.1.5",
    "eslint": "^7.11.0",
    "eslint-config-prettier": "^6.12.0",
    "eslint-import-resolver-alias": "^1.1.2",
    "eslint-plugin-babel": "^5.3.1",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-prettier": "^3.1.4",
    "eslint-plugin-react": "^7.21.2",
    "html-webpack-plugin": "^5.3.1",
    "material-ui": "^0.20.2",
    "mini-css-extract-plugin": "^1.4.0",
    "node-dev": "^6.6.0",
    "node-sass": "^5.0.0",
    "optimize-css-assets-webpack-plugin": "^5.0.4",
    "prettier": "^2.2.1",
    "react-loader": "^2.4.7",
    "sass-loader": "^11.0.1",
    "style-loader": "^2.0.0",
    "terser-webpack-plugin": "^4.2.3",
    "webpack": "^5.30.0",
    "webpack-cli": "^4.6.0",
    "webpack-dev-server": "^3.11.2",
    "webpack-merge": "^5.7.3"
  },
  "dependencies": {
    "@date-io/date-fns": "^1.3.13",
    "@material-ui/core": "^4.11.3",
    "@material-ui/icons": "^4.11.2",
    "@material-ui/lab": "^4.0.0-alpha.57",
    "@material-ui/pickers": "3.3.10",
    "anychart": "^8.9.0",
    "anychart-react": "^1.4.1",
    "axios": "^0.21.1",
    "babel-polyfill": "^6.26.0",
    "clsx": "^1.1.1",
    "core-js": "^3.10.0",
    "d3": "^6.6.2",
    "date-fns": "2.16.0",
    "decimal.js-light": "^2.5.1",
    "file-saver": "^2.0.5",
    "highcharts": "^9.0.1",
    "highcharts-pattern-fill": "^3.0.3",
    "highcharts-react-official": "^3.0.0",
    "lodash": "^4.17.21",
    "material-ui-number-input": "^5.0.16",
    "moment": "^2.29.1",
    "mui-datatables": "^3.7.7",
    "prop-types": "^15.7.2",
    "react": "^16.14.0",
    "react-confirm-alert": "^2.7.0",
    "react-cookie": "^4.0.3",
    "react-csv": "^2.0.3",
    "react-dom": "^16.14.0",
    "react-helmet": "^6.1.0",
    "react-html-parser": "^2.0.2",
    "react-idle-timer": "^4.5.6",
    "react-number-format": "^4.5.3",
    "react-observe-size": "^0.3.1",
    "react-redux": "^7.2.3",
    "react-router": "^5.2.0",
    "react-router-dom": "^4.3.1",
    "react-window": "^1.8.6",
    "redux": "^4.0.5",
    "redux-logger": "^3.0.6",
    "reqwest": "^2.0.5",
    "styled-components": "^5.2.3",
    "whatwg-fetch": "^3.6.2"
  }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.