coreui / coreui-free-bootstrap-admin-template

Free Bootstrap Admin & Dashboard Template
https://coreui.io/product/free-bootstrap-admin-template/
MIT License
11.94k stars 3.14k forks source link

npm WARN logfile Error: EPERM: operation not permitted, unlink #579

Closed Qrzysio closed 2 years ago

Qrzysio commented 2 years ago

Refers to: coreui-pro-bootstrap-admin-template-v4.1.0.zip

I unpack the .zip file. Then run yarn install command. Afterthat: npm run build causes this:

(...)
Successfully compiled 12 files with Babel (699ms).

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 css-prefix
> postcss --config build/postcss.config.js --replace "dist/css/*.css" "!dist/css/*.min.css"

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 css-minify
> cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix ".min" "dist/css/*.css" "!dist/css/*.min.css" "!dist/css/*rtl*.css"

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 build-vendors
> node build/vendors.js

npm WARN logfile Error: EPERM: operation not permitted, unlink 'C:\Users\system_username\AppData\Local\npm-cache\_logs\2021-12-07T18_30_15_652Z-debug-0.log'
npm WARN logfile  error removing log file C:/Users/system_username/AppData/Local/npm-cache/_logs/2021-12-07T18_30_15_652Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\system_username\AppData\Local\npm-cache\_logs\2021-12-07T18_30_15_652Z-debug-0.log'] {
npm WARN logfile   errno: -4048,
npm WARN logfile   code: 'EPERM',
npm WARN logfile   syscall: 'unlink',
npm WARN logfile   path: 'C:\\Users\\system_username\\AppData\\Local\\npm-cache\\_logs\\2021-12-07T18_30_15_652Z-debug-0.log'
npm WARN logfile }
Error: ENOENT: no such file or directory, lstat 'Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\datatables.net-bs4\css\https:\www.datatables.net\examples\resources\details_open.png"'
    at Object.lstatSync (node:fs:1514:3)
    at Object.lstatSync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\graceful-fs\polyfills.js:311:34)
    at statFunc (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\util\stat.js:24:20)
    at getStatsSync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\util\stat.js:25:19)
    at Object.checkPathsSync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\util\stat.js:67:33)
    at Object.copySync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\copy-sync\copy-sync.js:24:38)
    at Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\@coreui\vendors-injector\index.js:116:10
    at Array.forEach (<anonymous>)
    at injectVendors (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\@coreui\vendors-injector\index.js:114:26)
    at Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\@coreui\vendors-injector\index.js:133:18 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'Z:\\www\\coreui-pro-bootstrap-admin-template-v4.1.0\\node_modules\\datatables.net-bs4\\css\\https:\\www.datatables.net\\examples\\resources\\details_open.png"'
}
Error: ENOENT: no such file or directory, lstat 'Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\datatables.net-bs4\css\https:\www.datatables.net\examples\resources\details_close.png"'
    at Object.lstatSync (node:fs:1514:3)
    at Object.lstatSync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\graceful-fs\polyfills.js:311:34)
    at statFunc (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\util\stat.js:24:20)
    at getStatsSync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\util\stat.js:25:19)
    at Object.checkPathsSync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\util\stat.js:67:33)
    at Object.copySync (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\fs-extra\lib\copy-sync\copy-sync.js:24:38)
    at Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\@coreui\vendors-injector\index.js:116:10
    at Array.forEach (<anonymous>)
    at injectVendors (Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\@coreui\vendors-injector\index.js:114:26)
    at Z:\www\coreui-pro-bootstrap-admin-template-v4.1.0\node_modules\@coreui\vendors-injector\index.js:133:18 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'Z:\\www\\coreui-pro-bootstrap-admin-template-v4.1.0\\node_modules\\datatables.net-bs4\\css\\https:\\www.datatables.net\\examples\\resources\\details_close.png"'
}

Any ideas?

mrholek commented 2 years ago

@Qrzysio I'm working on it. I will fix it ASAP

mrholek commented 2 years ago

I fixed it, please update "@coreui/vendors-injector" to "^1.1.4"

Qrzysio commented 2 years ago

A bit better, but still not working. Now I get the below error.


(...)

Successfully compiled 12 files with Babel (967ms).

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 css-prefix
> postcss --config build/postcss.config.js --replace "dist/css/*.css" "!dist/css/*.min.css"

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 css-minify
> cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix ".min" "dist/css/*.css" "!dist/css/*.min.css" "!dist/css/*rtl*.css"

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 build-vendors
> node build/vendors.js

npm WARN logfile Error: EPERM: operation not permitted, unlink 'C:\Users\system_username\AppData\Local\npm-cache\_logs\2021-12-08T20_29_48_110Z-debug-0.log'
npm WARN logfile  error removing log file C:/Users/system_username/AppData/Local/npm-cache/_logs/2021-12-08T20_29_48_110Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\system_username\AppData\Local\npm-cache\_logs\2021-12-08T20_29_48_110Z-debug-0.log'] {
npm WARN logfile   errno: -4048,
npm WARN logfile   code: 'EPERM',
npm WARN logfile   syscall: 'unlink',
npm WARN logfile   path: 'C:\\Users\\system_username\\AppData\\Local\\npm-cache\\_logs\\2021-12-08T20_29_48_110Z-debug-0.log'
npm WARN logfile }
mrholek commented 2 years ago

Try this:

  1. remove node_modules and package-lock.json
  2. remove dist folder
  3. npm cache clean
  4. npm install
  5. npm run build
Qrzysio commented 2 years ago

Thanks. It turned out that cleaning the cache requires --force: npm cache clean --force

Surprisingly, a different behaviour is when I install via yarn and different when using npm.

Using yarn causes the error described above, even after upgrading @coreui/vendors-injector to ^1.1.4.

When using npm there are lack of CSS files.

> @coreui/coreui-pro-bootstrap-admin-template@4.1.0 copy-views
> copyfiles -a -u 2 "src/views/**/*.html" dist/

Successfully compiled 12 files with Babel (805ms).
Error: Can't find stylesheet to import.
  ╷
8 │ @import "@coreui/coreui-pro/scss/coreui";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src\scss\style.scss 8:9  root stylesheet
ERROR: "css-compile" exited with 65.
ERROR: "css" exited with 1.

Thanks for your help!

Qrzysio commented 2 years ago

@mrholek any update?