roman01la / webpack-closure-compiler

[DEPRECATED] Google Closure Compiler plugin for Webpack
MIT License
464 stars 25 forks source link

Error: EPERM: operation not permitted when using `create_source_map: true` #45

Open Aqours opened 6 years ago

Aqours commented 6 years ago

Node: 10.0.0 System: Windows 10 webpack-closure-compiler: 2.1.6 google-closure-compiler: 20170521.0.0

Error log

D:\git\corp\fakename\node_modules\temp\node_modules\rimraf\rimraf.js:137
      throw er
      ^

Error: EPERM: operation not permitted, unlink 'C:\Users\fake\AppData\Local\Temp\ccwp-dump-118417-17908-1f8a0mj.xn1m'
    at Object.fs.unlinkSync (fs.js:1015:3)
    at rimrafSync (D:\git\corp\fakename\node_modules\temp\node_modules\rimraf\rimraf.js:211:13)
    at cleanupFilesSync (D:\git\corp\fakename\node_modules\temp\lib\temp.js:88:5)
    at process.cleanupSync (D:\git\corp\fakename\node_modules\temp\lib\temp.js:195:19)
    at process.emit (events.js:182:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fakename@0.9.28 build: `npm run prefetch && npm run tslint && webpack --env.prod --display=errors-only`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the fakename@0.9.28 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\fake\AppData\Roaming\npm-cache\_logs\2018-05-17T10_42_02_279Z-debug.log

Process finished with exit code 1
Aqours commented 6 years ago

It seems https://github.com/roman01la/webpack-closure-compiler/issues/37#issuecomment-342331286 can solve the problem. The issue had been closed by https://github.com/roman01la/webpack-closure-compiler/pull/39 PR which didn't fix the issue actually.

https://github.com/roman01la/webpack-closure-compiler/blob/36b2cdd9bc3a93ceca0ccf1ad80e0a3189c4e763/index.js#L8

https://github.com/roman01la/webpack-closure-compiler/blob/36b2cdd9bc3a93ceca0ccf1ad80e0a3189c4e763/index.js#L88

=>

var temp = require('temp');
// ...
// fs.unlinkSync(outputSourceMapFile.path);