angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

EPERM: operation not permitted, unlink

Open ssashok10 opened this issue 9 years ago • 20 comments

I am getting the similar error when I tried to install with Angular 4.2.4 [ npm i ag-grid --save ]. My node version is 8.4.0 and npm version is 5.4.1. The installation is conflicting something with "fsevents"...I even tried to use the command "npm cache clean --force"...Here is the error,

npm ERR! path I:\git\AngularAppSample\node_modules fsevents\node_modules\abbrev\package.json npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'I:\git\AngularAppSample\node_modules\fsevents\node_modules\abbrev\package.j son' npm ERR! { Error: EPERM: operation not permitted, unlink 'I:\git\AngularAppSamplenode_modules\fsevents\node_modules\abbrev\packag e.json' npm ERR! stack: 'Error: EPERM: operation not permitted, unlink 'I:\git\AngularAppSample\node_modules\fsevents\node_modul es\abbrev\package.json'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'I:\git\AngularAppSample\nod e_modules\fsevents\node_modules\abbrev\package.json' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\sath\AppData\Roaming\npm-cache_logs\2017-09-12T21_37_0 9_061Z-debug.log

ssashok10 avatar Sep 13 '17 13:09 ssashok10

I'm having the same issue. Latest NPM / Nodejs / Yarn

wynhou avatar Sep 13 '17 19:09 wynhou

It's a known NPM 5.4 issue. Downgrade to 5.3. https://github.com/npm/npm/issues/18380

andrexx avatar Sep 13 '17 21:09 andrexx

Hello, This issue is fixed once I cleaned up the node_modules folder completely and re-import all the packages again. I am using NPM 5.4.1. Thank you for your suggestion.

ssashok10 avatar Sep 14 '17 15:09 ssashok10

Same error

npm ERR! path C:\Users\Jishnu\Desktop\my-app\node_modules\fsevents\node_modules npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall scandir npm ERR! Error: EPERM: operation not permitted, scandir 'C:\Users\Jishnu\Desktop\my-app\node_modules\fsevents\node_modules' npm ERR! { Error: EPERM: operation not permitted, scandir 'C:\Users\Jishnu\Desktop\my-app\node_modules\fsevents\node_modules' npm ERR! stack: 'Error: EPERM: operation not permitted, scandir 'C:\Users\Jishnu\Desktop\my-app\node_modules\fsevents\node_modules'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'scandir', npm ERR! path: 'C:\Users\Jishnu\Desktop\my-app\node_modules\fsevents\node_modules' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Jishnu\AppData\Roaming\npm-cache_logs\2017-10-19T02_38_07_564Z-debug.log

Package install failed, see above. Package install failed, see above.

jishnudev avatar Oct 19 '17 02:10 jishnudev

@jishnudev Try to close your IDE and execute again from console.

andrexx avatar Oct 19 '17 12:10 andrexx

@andrexx thanks for your help, in my case I closed all prompt IDE etc and run again its work

rafaelzuckerberg avatar Jan 23 '18 01:01 rafaelzuckerberg

Thanks @ssashok10 . It's Resolve after deleting node_modules folder and install all node packages again.

navalkishor3 avatar Jan 24 '18 09:01 navalkishor3

try deleting the node_modules and install the dependencies again...!

saleemmalikraja avatar Feb 24 '18 08:02 saleemmalikraja

close IDE, and reinstall worked for me.

timsar2 avatar Jul 31 '18 10:07 timsar2

  1. Run command prompt as Administrator.
  2. Ran npm clean cache. After run this command and return Error than run . ( npm cache clean --force )
  3. npm install -g angular-cli

patelvasu avatar Aug 09 '18 17:08 patelvasu

I am getting the similar error when I tried to install with Angular 6.0. My node version isv8.11.3 and npm version is6.1.0. The installation is conflicting something with "fsevents"...I even tried to use the command "npm cache clean --force"...Here is the error,

26322 warn @swimlane/[email protected] requires a peer of @types/dragula@^2.1.33 but none is installed. You must install peer dependencies yourself. 26323 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\node-sass): 26324 warn enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into 'H:\angular-material-app-master\node_modules.staging\node-sass-849c4ff0' 26325 verbose enoent SKIPPING OPTIONAL DEPENDENCY: This is related to npm not being able to find a file. 26325 verbose enoent SKIPPING OPTIONAL DEPENDENCY: 26326 verbose stack Error: EPERM: operation not permitted, unlink 'H:\angular-material-app-master\node_modules.staging@angular\compiler-f002f831\bundles\compiler.umd.min.js.map' 26327 verbose cwd H:\angular-material-app-master 26328 verbose Windows_NT 10.0.17134 26329 verbose argv "F:\node\install\node.exe" "C:\Users\peng\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" 26330 verbose node v8.11.3 26331 verbose npm v6.1.0 26332 error path H:\angular-material-app-master\node_modules.staging@angular\compiler-f002f831\bundles\compiler.umd.min.js.map 26333 error code EPERM 26334 error errno -4048 26335 error syscall unlink 26336 error Error: EPERM: operation not permitted, unlink 'H:\angular-material-app-master\node_modules.staging@angular\compiler-f002f831\bundles\compiler.umd.min.js.map' 26336 error { Error: EPERM: operation not permitted, unlink 'H:\angular-material-app-master\node_modules.staging@angular\compiler-f002f831\bundles\compiler.umd.min.js.map' 26336 error cause: 26336 error { Error: EPERM: operation not permitted, unlink 'H:\angular-material-app-master\node_modules.staging@angular\compiler-f002f831\bundles\compiler.umd.min.js.map' 26336 error errno: -4048, 26336 error code: 'EPERM', 26336 error syscall: 'unlink', 26336 error path: 'H:\angular-material-app-master\node_modules\.staging\@angular\compiler-f002f831\bundles\compiler.umd.min.js.map' }, 26336 error stack: 'Error: EPERM: operation not permitted, unlink 'H:\angular-material-app-master\node_modules\.staging\@angular\compiler-f002f831\bundles\compiler.umd.min.js.map'', 26336 error errno: -4048, 26336 error code: 'EPERM', 26336 error syscall: 'unlink', 26336 error path: 'H:\angular-material-app-master\node_modules\.staging\@angular\compiler-f002f831\bundles\compiler.umd.min.js.map', 26336 error parent: 'angular-material-app' } 26337 error The operation was rejected by your operating system. 26337 error It's possible that the file was already in use (by a text editor or antivirus), 26337 error or that you lack permissions to access it. 26337 error 26337 error If you believe this might be a permissions issue, please double-check the 26337 error permissions of the file and its containing directories, or try running 26337 error the command again as root/Administrator (though this is not recommended). 26338 verbose exit [ -4048, true ]

peng2013 avatar Aug 19 '18 14:08 peng2013

I try to do with administrator,but also error

peng2013 avatar Aug 19 '18 14:08 peng2013

npm http fetch GET 200 https://registry.npmjs.org/smart-buffer 13221ms npm http fetch GET 200 https://registry.npmjs.org/concat-stream 134206ms npm WARN tarball tarball data for https://registry.npmjs.org/grpc/-/grpc-1.13.1.tgz (sha512-yl0xChnlUISTefOPU2NQ1cYPh5m/DTatEUV6jdRyQPE9NCrtPq7Gn6J2alMTglN7ufYbJapOd00dvhGurHH6HQ==) seems to be corrupted. Trying one more time. npm timing stage:rollbackFailedOptional Completed in 1ms npm timing stage:runTopLevelLifecycles Completed in 1824274ms npm ERR! path C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc' npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc' npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc' }, npm ERR! isOperational: true, npm ERR! stack: 'Error: EPERM: operation not permitted, unlink 'C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\Users\peng\AppData\Local\Temp\npm-4672-a4c6ef20\unpack-ae2ffde8\deps\grpc\src\boringssl\crypto_test_data.cc', npm ERR! parent: '@firebase/firestore' } 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 timing npm Completed in 1829064ms

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\peng\AppData\Roaming\npm-cache_logs\2018-08-19T15_15_24_624Z-debug.log

H:\angular-material-app-master>

peng2013 avatar Aug 19 '18 15:08 peng2013

I was able to fix this by running the command prompt/bash as admin and closing VSCode! Seems like VSCode was locking some files. Potentially something else could be locking these files for you.

markwhitfeld avatar Oct 09 '18 19:10 markwhitfeld

i have the same issue, while installation of node-sass

npm ERR! path C:\Projects<myprojectlocation>\node_modules@angular\cdk\esm5 npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Projects<myprojectlocation>\node_modules@angular\cdk\esm5' npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Projects<myprojectlocation>\node_modules@angular\cdk\esm5' npm ERR! cause: npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Projects<myprojectlocation>\node_modules@angular\cdk\esm5' npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\Projects\\node_modules\@angular\cdk\esm5' }, npm ERR! stack: 'Error: EPERM: operation not permitted, unlink 'C:\Projects\\node_modules\@angular\cdk\esm5'', npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\Projects<myprojectlocation>\node_modules\@angular\cdk\esm5', npm ERR! parent: 'marketpricer' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\prashant-mishra\AppData\Roaming\npm-cache_logs\2018-10-10T10_44_02_089Z-debug.log

below command worked for me.

npm install --no-bin-links

prashuMishra avatar Oct 10 '18 11:10 prashuMishra

Any luck here, I have run into the same proble and its crazy that even after reinstallign node and npm i am getting that error :(

deepakjha14 avatar Dec 13 '18 13:12 deepakjha14

you must checkout this files first, if you are working on source control. package.json , angular.json, app.module.ts this way worked for me.

Rouhollah avatar Mar 19 '19 09:03 Rouhollah

i am getting this error please someone solve this

./node_modules/angularfire2/auth.js Module build failed: Error: EPERM: operation not permitted, open 'C:\Users\Arslan Malik\oshop\node_modules\angularfire2\auth.js' at Object.openSync (fs.js:448:3) at Object.readFileSync (fs.js:348:35) at Storage.provideSync (C:\Users\Arslan Malik\oshop\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:98:13) at CachedInputFileSystem.readFileSync (C:\Users\Arslan Malik\oshop\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:259:32) at Observable.rxjs_1.Observable.obs [as _subscribe] (C:\Users\Arslan Malik\oshop\node_modules@ngtools\webpack\src\webpack-input-host.js:35:51) at Observable._trySubscribe (C:\Users\Arslan Malik\oshop\node_modules\rxjs\internal\Observable.js:44:25) at Observable.subscribe (C:\Users\Arslan Malik\oshop\node_modules\rxjs\internal\Observable.js:30:22) at SyncDelegateHost._doSyncCall (C:\Users\Arslan Malik\oshop\node_modules@angular-devkit\core\src\virtual-fs\host\sync.js:22:20) at SyncDelegateHost.read (C:\Users\Arslan Malik\oshop\node_modules@angular-devkit\core\src\virtual-fs\host\sync.js:49:21) at WebpackCompilerHost.readFileBuffer (C:\Users\Arslan Malik\oshop\node_modules@ngtools\webpack\src\compiler_host.js:125:44) at VirtualFileSystemDecorator.readFile (C:\Users\Arslan Malik\oshop\node_modules@ngtools\webpack\src\virtual_file_system_decorator.js:39:54) at processResource (C:\Users\Arslan Malik\oshop\node_modules\loader-runner\lib\LoaderRunner.js:202:11) at iteratePitchingLoaders (C:\Users\Arslan Malik\oshop\node_modules\loader-runner\lib\LoaderRunner.js:158:10) at runLoaders (C:\Users\Arslan Malik\oshop\node_modules\loader-runner\lib\LoaderRunner.js:365:2) at NormalModule.doBuild (C:\Users\Arslan Malik\oshop\node_modules\webpack\lib\NormalModule.js:280:3) at NormalModule.build (C:\Users\Arslan Malik\oshop\node_modules\webpack\lib\NormalModule.js:427:15)

MalikArslanAhmed avatar Apr 09 '19 14:04 MalikArslanAhmed

While opening the solution in Visual Studio is locking some configuration files. So sometimes it shows this type of errors. Close the solution opened in VS Code Or any other editor and run the command from cmd prompt will solve the issue.

For running the command from cmd prompt, Just go to your project folder then press Shift + Right-Click then click Open command window here. Then type the npm install...

abhijithcraj avatar Jul 15 '19 08:07 abhijithcraj

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.