1

While trying to fix a material-ui component "Popper" error saying it can't find it's module, i did a few npm commands:

npm install react-popper@next --save

npm install avj

npm install --save-dev webpack

npm install & npm update

After this i couldnt make the project compile again; I tried deleting node_modules then npm install, and i also installed the webpack-cli module.

Terminalenter image description here

package.json

{
  "name": "auto-club-reviews",
  "description": "Auto Club Reviews Blog",
  "version": "1.0.0",
  "author": "Sofianu Alin",
  "dependencies": {
    "@material-ui/core": "^1.4.3",
    "@material-ui/icons": "^1.1.0",
    "gatsby": "^1.9.277",
    "gatsby-link": "^1.6.46",
    "gatsby-plugin-feed": "^1.3.25",
    "gatsby-plugin-google-analytics": "^1.0.31",
    "gatsby-plugin-offline": "^1.0.18",
    "gatsby-plugin-react-helmet": "^2.0.11",
    "gatsby-plugin-react-next": "^1.0.11",
    "gatsby-plugin-sharp": "^1.6.48",
    "gatsby-plugin-typography": "^1.7.19",
    "gatsby-remark-copy-linked-files": "^1.5.37",
    "gatsby-remark-images": "^1.5.67",
    "gatsby-remark-responsive-iframe": "^1.4.20",
    "gatsby-remark-smartypants": "^1.4.12",
    "gatsby-source-contentful": "^1.3.54",
    "gatsby-source-filesystem": "^1.5.39",
    "gatsby-transformer-remark": "^1.7.44",
    "gatsby-transformer-sharp": "^1.6.27",
    "lodash": "^4.17.10",
    "react": "^16.4.2",
    "react-dom": "^16.4.2",
    "react-helmet": "^5.2.0",
    "react-hover": "^1.3.2",
    "react-popper": "^1.0.2",
    "typeface-roboto": "0.0.54",
    "typography-theme-alton": "^0.15.10",
    "typography-theme-lincoln": "^0.15.11",
    "typography-theme-wordpress-2016": "^0.15.10",
    "webpack-command": "^0.4.1"
  },
  "devDependencies": {
    "eslint": "^5.3.0",
    "eslint-plugin-react": "^7.10.0",
    "gh-pages": "^1.2.0",
    "html-webpack-plugin": "^3.2.0",
    "prettier": "^1.14.2",
    "webpack": "^4.16.5",
    "webpack-cli": "^3.1.0",
    "webpack-dev-middleware": "^3.1.3",
    "webpack-dev-server": "^3.1.5"
  },
  "homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "main": "n/a",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
  },
  "scripts": {
    "dev": "gatsby develop",
    "lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
    "test": "echo \"Error: no test specified\" && exit 1",
    "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js' 'src/**/*.md'",
    "develop": "gatsby develop",
    "build": "gatsby build",
    "deploy": "gatsby build --prefix-paths && gh-pages -d public",
    "fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js"
  }
}

Any ideas whats happening anyone?

index.jsx
  • 163
  • 2
  • 15
  • dependencies that u list mention 2 diff major versions of 'webpack' which may be in conflict.. maybe review and reconcile that and redo the npm 'install' and retry... – Robert Rowntree Aug 10 '18 at 15:39
  • may be you can try `yarn` instead of `npm` – Nahid Aug 10 '18 at 15:41
  • @RobertRowntree i have seen someone fixing something similar by recommending to only have 1 version of webpack; but whats happening, i only see "webpack": "^4.16.5", the rest aren't the same exact thing – index.jsx Aug 10 '18 at 16:13
  • u r using both 4. and 3. "webpack": "^4.16.5", "webpack-cli": "^3.1.0", – Robert Rowntree Aug 10 '18 at 16:28
  • @RobertRowntree Removed "webpack-cli": "^3.1.0", deleted node_modules then did npm install. Problem persisted. In this [question](https://stackoverflow.com/questions/43179531/error-cannot-find-module-webpack-lib-node-nodetemplateplugin) top comment said: Webpack 4 onwards you are required to install webpack-cli. – index.jsx Aug 10 '18 at 16:55
  • @index.html you don't have to, if you have webpack-commander – PlayMa256 Aug 10 '18 at 17:08
  • @PlayMa256 I unninstalled webpack-cli and installed webpack-commander, as i read that they are alternatives to each other and cannot coexist. Terminal still gives the same error as in the screenshot above. – index.jsx Aug 10 '18 at 17:14
  • I fixed this issue with [this answer](https://stackoverflow.com/a/53470468/7569936) – ComNurz Mar 07 '19 at 16:07

0 Answers0