node.js - webpack-dev-server错误: EPERM: operation not permitted,统计 'D:\System Volume Information'

标签 node.js windows npm webpack-dev-server

在我重新安装 Windows 并从 GitHub 克隆项目后,我收到 npm 错误:EPERM:不允许操作 D:\System Volume Information

在终端中我运行:

webpack-dev-server --open --config webpack.dev.js 

它编译得很好,但是当我在http://localhost:8000/上打开浏览器时它说:

Internal Server Error

当我检查终端时,我可以看到:

i 「wdm」: Compiled successfully.
Error: EPERM: operation not permitted, stat 'D:\System Volume Information'
<小时/>

所以我的 webpack 编译一切顺利,问题是当我尝试在 localhost:8000 打开它时

已经尝试过

  • 删除node_modules
  • npm 缓存清理 --force
  • npm 安装 npm@6.4.0 和 npm@6.3.0
  • 重新安装node.js
  • 使用端口 9000
  • 以管理员身份运行终端
  • 重新安装 webpack-dev-server
  • 禁用卡巴斯基防病毒软件
  • 从 C:\Users\.config\configstore\删除文件
{
  "name": "site",
  "version": "1.0.0",
  "main": "webpack.base.js",
  "scripts": {
    "start": "webpack-dev-server --open --config webpack.dev.js",
    "build": "webpack --config webpack.prod.js "
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@babel/plugin-syntax-optional-catch-binding": "^7.0.0",
    "@babel/plugin-transform-async-to-generator": "^7.1.0",
    "@babel/preset-react": "^7.0.0",
    "@babel/template": "^7.1.2",
    "@babel/types": "^7.1.3",
    "adjust-sourcemap-loader": "^1.2.0",
    "autoprefixer": "^9.3.1",
    "babel": "^6.23.0",
    "babel-core": "^6.26.3",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "bootstrap": "^4.1.3",
    "debug": "^4.1.0",
    "detect-libc": "^1.0.3",
    "glob": "^7.1.3",
    "gsap": "^2.0.2",
    "html-loader": "^0.5.5",
    "html-webpack-plugin": "^3.2.0",
    "imagemin-pngquant": "^5.1.0",
    "jquery": "^3.3.1",
    "locate-path": "^3.0.0",
    "lodash": "^4.17.11",
    "lodash._baseassign": "^3.2.0",
    "lodash._basecopy": "^3.0.1",
    "lodash.isarguments": "^3.1.0",
    "lodash.keys": "^4.2.0",
    "ms": "^2.1.1",
    "npm": "^6.5.0",
    "only": "0.0.2",
    "owl.carousel": "^2.3.4",
    "pngquant-bin": "^3.1.1",
    "popper.js": "^1.14.4",
    "pretty-error": "^2.1.1",
    "raw-loader": "^0.5.1",
    "svg-url-loader": "^2.3.2",
    "toposort": "^2.0.2",
    "uglifyjs-webpack-plugin": "^2.0.1",
    "update": "^0.7.4",
    "util-promisify": "^2.1.0",
    "webpack-cli": "^3.1.2"
  },
  "devDependencies": {
    "@babel/cli": "^7.1.2",
    "@babel/core": "^7.1.5",
    "@babel/parser": "^7.1.3",
    "@babel/preset-env": "^7.1.6",
    "@webpack-cli/init": "^0.1.2",
    "babel-loader": "^8.0.4",
    "babel-minify-webpack-plugin": "^0.3.1",
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "clean-webpack-plugin": "^0.1.19",
    "critters-webpack-plugin": "^2.0.1",
    "css-loader": "^1.0.1",
    "eslint": "^5.9.0",
    "extract-text-webpack-plugin": "^3.0.2",
    "file-loader": "^2.0.0",
    "html-critical-webpack-plugin": "^2.1.0",
    "mini-css-extract-plugin": "^0.4.5",
    "node-sass": "^4.9.4",
    "optimize-css-assets-webpack-plugin": "^5.0.1",
    "postcss-loader": "^3.0.0",
    "purify-css": "^1.2.5",
    "purifycss-webpack": "^0.7.0",
    "resolve-url-loader": "^3.0.0",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.23.1",
    "svg-inline-loader": "^0.8.0",
    "url-loader": "^1.1.2",
    "webpack": "^4.26.0",
    "webpack-manifest-plugin": "^2.0.4",
    "webpack-merge": "^4.1.4"
  },
  "description": ""
}

版本

  • npm -v 6.5.0
  • Node -v 11.4.0
  • Windows 10.0.17134

最佳答案

我通过在管理模式下打开 Visual Studio Code 解决了这个问题。

关于node.js - webpack-dev-server错误: EPERM: operation not permitted,统计 'D:\System Volume Information',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53739724/

相关文章:

javascript - 为什么不显示 ' admin' 页面?

windows - 如何在 Windows 上配置用户特定的主机文件

c++ - Windows 7(32 位)上带有 libstdc++-6.dll 的 clang++ 3.2

node.js - 当我尝试创建一个 react 应用程序时,它给出了一个错误

javascript - 使用 Node.JS SerialPort 发送短信

node.js - 认证失败。 couchbase 中的 OpenBucket

javascript - onclick 函数在 Node js 中不起作用

c++ - IUpdateSearcher 性能问题

javascript - 如何控制所有开发者使用相同的库版本?

javascript - npm 漏洞对前端重要吗?