EPERM: operation not permitted unlink while installing dependencies

I started a new project. I use expo init <name>. I chose a blank template. While installing dependencies, it got stuck at extracting react native web. The installation took really long. And then this error appeared. It failed.

12455 verbose stack Error: EPERM: operation not permitted, unlink 'D:\ComputerProjects\School\Com2019-Noteshare\project-noteshare\node_modules\.staging\react-native-bfcd8060\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testLayoutExample_1-iOS11@2x.png'
12456 verbose cwd D:\ComputerProjects\School\Com2019-Noteshare\project-noteshare
12457 verbose Windows_NT 6.1.7601
12458 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
12459 verbose node v10.16.1
12460 verbose npm  v6.9.0
12461 error path D:\ComputerProjects\School\Com2019-Noteshare\project-noteshare\node_modules\.staging\react-native-bfcd8060\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testLayoutExample_1-iOS11@2x.png
12462 error code EPERM
12463 error errno -4048
12464 error syscall unlink
12465 error Error: EPERM: operation not permitted, unlink 'D:\ComputerProjects\School\Com2019-Noteshare\project-noteshare\node_modules\.staging\react-native-bfcd8060\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testLayoutExample_1-iOS11@2x.png'
12465 error  { [Error: EPERM: operation not permitted, unlink 'D:\ComputerProjects\School\Com2019-Noteshare\project-noteshare\node_modules\.staging\react-native-bfcd8060\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testLayoutExample_1-iOS11@2x.png']
12465 error   cause:
12465 error    { Error: EPERM: operation not permitted, unlink 'D:\ComputerProjects\School\Com2019-Noteshare\project-noteshare\node_modules\.staging\react-native-bfcd8060\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testLayoutExample_1-iOS11@2x.png'
12465 error      errno: -4048,
12465 error      code: 'EPERM',
12465 error      syscall: 'unlink',
12465 error      path:
12465 error       'D:\\ComputerProjects\\School\\Com2019-Noteshare\\project-noteshare\\node_modules\\.staging\\react-native-bfcd8060\\RNTester\\RNTesterIntegrationTests\\ReferenceImages\\RNTester-js-RNTesterApp.ios\\testLayoutExample_1-iOS11@2x.png' },
12465 error   stack:
12465 error    'Error: EPERM: operation not permitted, unlink \'D:\\ComputerProjects\\School\\Com2019-Noteshare\\project-noteshare\\node_modules\\.staging\\react-native-bfcd8060\\RNTester\\RNTesterIntegrationTests\\ReferenceImages\\RNTester-js-RNTesterApp.ios\\testLayoutExample_1-iOS11@2x.png\'',
12465 error   errno: -4048,
12465 error   code: 'EPERM',
12465 error   syscall: 'unlink',
12465 error   path:
12465 error    'D:\\ComputerProjects\\School\\Com2019-Noteshare\\project-noteshare\\node_modules\\.staging\\react-native-bfcd8060\\RNTester\\RNTesterIntegrationTests\\ReferenceImages\\RNTester-js-RNTesterApp.ios\\testLayoutExample_1-iOS11@2x.png' }
12466 error The operation was rejected by your operating system.
12466 error It's possible that the file was already in use (by a text editor or antivirus),
12466 error or that you lack permissions to access it.
12466 error
12466 error If you believe this might be a permissions issue, please double-check the
12466 error permissions of the file and its containing directories, or try running
12466 error the command again as root/Administrator (though this is not recommended).
12467 verbose exit [ -4048, true ]`

I did not open text editor.

I also had a warning before extracting react native web.

npm WARN tarball tarball data for react-native@https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz (sha512-A9
OfDlTZN9haCCSeX+jq/5HU1b7/0EQNKKJIz0dfYKLCYj1lZAJhoQb1xtGoRaTYKk/fcRwxe/amIYms9mFjAg==) seems to be corrupted. Trying on
e more time.

I looked on the net and I found that this warning was the reason the installation took really long.

I tried to update Node, npm, Expo, clear cache, run as administrator, change folder attribute, disable anti-virus. Nothing worked.

PS. I tried to set up a new project on another machine. It worked. It didn’t work on my machine.

I downgraded the packages and the installation worked.

I downgraded to:

"dependencies": {
    "expo": "^33.0.0",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-web": "^0.11.4",
    "react-navigation": "^2.0.4"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.1.1"
  }

So, something wrong with the new version?

My pc is running Windows 7 64-bit.

I don’t think this is Expo-related, more likely that it has something to do with your PC permissions setup

Check out this thread for some possible fixes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.