【问题标题】:An unexpected error occurred: "EPERM: operation not permitted"发生意外错误:“EPERM:不允许操作”
【发布时间】:2021-11-14 00:12:23
【问题描述】:

我已经安装了 ReactJS 来处理一些项目,但是这个错误让我感到恶心。 当我尝试为我的项目添加包时出现第一个错误。 所以,我用了:

yarn add @material-ui/icons  

然后它正在获取。 我在终端线上收到了这条错误消息:

error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\React\\MyProject\\node_modules\\node-sass\\vendor\\win32-x64-93\\bindiinfo Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

我找到了一些解决方案并想尝试一下。每当我尝试使用 install 命令时,它都不允许我使用。 它给出了这个错误

npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\XXXXXX\AppData\Roaming\npm-cache\_logs\2021-11-14T00_08_12_781Z-debug.log
enter code here

每当我单击此错误日志时,都会看到以下内容。

    0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\XXXXXXXX\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'yarn'
1 verbose cli ]
2 info using npm@5.3.0
3 info using node@v16.13.0
4 verbose npm-session 95556b4f7a104717
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/yarn 188ms
8 http fetch GET 200 https://registry.npmjs.org/yarn/-/yarn-1.22.17.tgz 120ms
9 silly pacote tag manifest for yarn@latest fetched in 352ms
10 verbose stack TypeError: cb.apply is not a function
10 verbose stack     at C:\Users\XXXXXXX\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18
10 verbose stack     at FSReqCallback.oncomplete (node:fs:199:5)
11 verbose cwd D:\React\projem
12 verbose Windows_NT 10.0.19043
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\XXXXXXXX\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "yarn"
14 verbose node v16.13.0
15 verbose npm  v5.3.0
16 error cb.apply is not a function
17 verbose exit [ 1, true ]

请帮帮我,否则我很快就会发疯! 祝大家一切顺利,谢谢!为您提供帮助。

【问题讨论】:

  • 也许您的捆绑包在另一个终端中以监视模式运行?如果找不到,请重新启动计算机并重试。

标签: node.js reactjs npm npm-install


【解决方案1】:

请停止开发服务器并安装或添加包。

【讨论】:

    【解决方案2】:

    当我尝试使用 yarn 安装蓝图包时遇到了同样的问题,我通过使用 npm 包管理器 (npm install) 解决了这个问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-07
      • 1970-01-01
      • 1970-01-01
      • 2021-01-14
      • 2021-11-18
      • 2017-04-28
      • 2022-10-18
      • 1970-01-01
      相关资源
      最近更新 更多