发生意外错误:“EPERM:不允许操作”

问题描述 投票:0回答:3

我已经安装了 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.

我找到了一些解决方案并想尝试。每当我尝试使用安装命令时,它都不让我这样做。 它给出了这个错误

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 [email protected]
3 info using [email protected]
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
3个回答
15
投票

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


0
投票

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


0
投票

Avast Antivirus 是我的罪魁祸首。禁用它。

© www.soinside.com 2019 - 2024. All rights reserved.