node.js - npm 或 webpack 错误:找不到模块 'webpack/lib/removeAndDo'
问题描述
在尝试修复 material-ui 组件“Popper”错误说它找不到它的模块时,我做了一些 npm 命令:
npm install react-popper@next --save
npm 安装 avj
npm install --save-dev webpack
npm 安装和 npm 更新
在此之后我无法再次编译项目;我尝试删除 node_modules 然后 npm install,并且我还安装了 webpack-cli 模块。
包.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"
}
}
任何想法发生了什么任何人?
解决方案
推荐阅读
- apache - 通过 Zuul 路由 HTTP 静态内容请求
- authentication - 有没有办法将另一个用户添加到我的帐户?
- php - 如何检查 SQLite 行是否为空
- python - Python Bytecode + LOAD_NAME 按值还是按名称?
- c - 如何使用证书的根 ca 信任列表(即 json 数组)验证公共证书
- javascript - 从 DateTimeRangePicker 更新时间不会立即更新
- python - 有没有更快或更好的方法来组合两个 2d-numpy 数组(如 OR)而不加数字?
- node.js - NestJS Graphql CORS:通过远程主机访问 API 时出现问题,而在本地主机上运行
- java - JDBC MS Sql Server 和 jboss-eap-7.0 错误 IJ030027:正在破坏无效的连接
- java - java从包中加载时无法查看html中的图像src