- 操作系统 : 视窗 10.
- npm 版本 : 6.9.0
- 节点版本 : 12.4.0
我正在开发一个世博会应用程序。我想在我的博览会应用程序上安装所有软件包(npm 安装(。但是,发生了错误:
17254 error [OperationalError: EPERM: operation not permitted, unlink ...
我已经在许多主题上看到了这个错误,但没有人回答我的问题。
我已经尝试过:
- 以管理员身份启动我的终端。
- npm config set safe-perm=true.
- npm 安装 --no-bin-links
- npm 缓存清除 --强制
我有的错误消息示例:
17254 error cause: [Error: EPERM: operation not permitted, unlink 'C:UsersThomasDesktopsomeDirectorysomeDirectorysomeDirectorysomeDirectorynode_modules.stagingreact-native-99ed309fLibrariesRendererossReactFabric-dev.js'] {
17254 error errno: -4048,
17254 error code: 'EPERM',
17254 error syscall: 'unlink',
17254 error path: 'C:\Users\Thomas\Desktop\someDirectory\someDirectory\someDirectory\someDirectory\node_modules\.staging\react-native-99ed309f\Libraries\Renderer\oss\ReactFabric-dev.js'
17254 error },
17254 error stack: 'Error: EPERM: operation not permitted, unlink ' +
17254 error "'C:\Users\Thomas\Desktop\someDirectory\someDirectory\someDirectory\someDirectory\node_modules\.staging\react-native-99ed309f\Libraries\Renderer\oss\ReactFabric-dev.js'",
17254 error errno: -4048,
17254 error code: 'EPERM',
17254 error syscall: 'unlink',
17254 error path: 'C:\Users\Thomas\Desktop\someDirectory\someDirectory\someDirectory\someDirectory\node_modules\.staging\react-native-99ed309f\Libraries\Renderer\oss\ReactFabric-dev.js'
17254 error }
17255 error The operation was rejected by your operating system.
17255 error It's possible that the file was already in use (by a text editor or antivirus),
17255 error or that you lack permissions to access it.
17255 error
17255 error If you believe this might be a permissions issue, please double-check the
17255 error permissions of the file and its containing directories, or try running
17255 error the command again as root/Administrator (though this is not recommended).
17256 verbose exit [ -4048, true ] ```
是否有另一个正在运行的节点实例,它也在使用 ReactFabric-dev.js?如果是这样,请终止并重试。还要尝试将您的项目移动到"更靠近"根目录的文件夹中。Windows有时会与很长的路径混淆。
通过登录 npmjs 解决了这个问题: npm login
或
卸载所有 npm 模块并使用 npm install --no-bin-links
重新安装
或
rd /s /q C:UsersfooAppDataRoamingnpm-cache
rd /s /q C:UsersfooAppDataRoamingnpm
我有此错误消息,要解决它,您必须:
1( 在 Windows Defender 排除列表中添加您的项目文件夹。
2( 删除您的node_modules文件夹
3(运行:
npm install
我所做的是:
-
node_modules文件夹中删除;
-
以管理员身份打开 VSCode;
-
在终端中运行以下命令:
npm cache clean --force
npm install
首先尝试使用以下命令全局安装它
- npm install -g create-react-app
然后,您可以使用以下命令创建应用程序,
- NPX 创建-反应-应用