StephenGrider / rn-casts

Companion Repo for a React Native course on Udemy
https://www.udemy.com/the-complete-react-native-and-redux-course
865 stars 472 forks source link

npm install shows error #1

Open SufianAhmedMalik opened 5 years ago

SufianAhmedMalik commented 5 years ago

When I do npm install in rn-starter folder so it shows me many errors

npm ERR! path E:\React Native\First Practice\node_modules.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'E:\React Native\First Practice\node_modules.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png' npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'E:\React Native\First Practice\node_modules.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png'] { npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'E:\React Native\First Practice\node_modules.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'E:\React Native\First Practice\node_modules\.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png' npm ERR! }, npm ERR! stack: "Error: EPERM: operation not permitted, unlink 'E:\React Native\First Practice\node_modules\.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png'", npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'E:\React Native\First Practice\node_modules\.staging\react-native-3ae3ca51\RNTester\RNTesterIntegrationTests\ReferenceImages\RNTester-js-RNTesterApp.ios\testScrollViewExample_1-iOS10_tvOS.png' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Dell\AppData\Roaming\npm-cache_logs\2019-08-31T17_33_47_718Z-debug.log

Kisty commented 5 years ago

Have you tried updating npm as @StephenGrider suggests? https://nodejs.org/en/download/

Also, see https://www.udemy.com/the-complete-react-native-and-redux-course/learn/lecture/15909424#questions/7998872

jamiekeefer commented 4 years ago

Looks like you may have installed on E drive, the documents instruct you to:

"Next, make sure that your project files are on the C drive rather than on some external or remote drive. This may be causing permissions errors or inconsistencies with the install.".

I had the same issue.

alamba78 commented 4 years ago

I had the same error even with everything installed in the C drive. I had to run npm cache clear --force to get it to work.

sohamderoy commented 3 years ago

Hi there,

I also faced the same problem. Turns out, if you have done npm start and running the app in localhost, then it is throwing this error. Try terminating the localhost instance once and then run npm install. It worked for me.