os-js / osjs-cli

OS.js CLI Module
https://manual.os-js.org/v3/
Other
2 stars 6 forks source link

Possible issue with path resolution in discovery #5

Closed andersevenrud closed 6 years ago

andersevenrud commented 6 years ago

A user reported a strange issue when doing package discovery. I added a patch to not make it crash, and this was the response.


  package:discover Initialized timer...
[package:discover] › …  awaiting  Discovering packages
[package:discover] › …  watching  Using /home/smrsan/src/Clones/Web/OS.js/src/packages
[package:discover] › …  watching  Using /home/smrsan/src/Clones/Web/OS.js/node_modules
[package:discover] › …  awaiting  Flushing out old discoveries
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/fonts']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/fonts' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/sounds']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/sounds' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/icons']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/icons' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/styles']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/styles' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/wallpapers']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/wallpapers' }
[package:discover] › …  awaiting  Discovering packages
[package:discover] › ✔  success   12 package(s) discovered.
[package:discover] › ℹ  info      Discovered @osjs/calculator-application as Calculator
[package:discover] › ℹ  info      Discovered @osjs/draw-application as Draw
[package:discover] › ℹ  info      Discovered @osjs/filemanager-application as FileManager
[package:discover] › ℹ  info      Discovered @osjs/freedesktop-sounds as FreedesktopSounds
[package:discover] › ℹ  info      Discovered @osjs/gnome-icons as Gnome
[package:discover] › ℹ  info      Discovered @osjs/htmlviewer-application as HTMLViewer
[package:discover] › ℹ  info      Discovered @osjs/musicplayer-application as MusicPlayer
[package:discover] › ℹ  info      Discovered @osjs/preview-application as Preview
[package:discover] › ℹ  info      Discovered @osjs/settings-application as Settings
[package:discover] › ℹ  info      Discovered @osjs/standard-theme as Standard
[package:discover] › ℹ  info      Discovered @osjs/textpad-application as Textpad
[package:discover] › ℹ  info      Discovered @osjs/xterm-application as Xterm
◼  package:discover Timer run for: 424ms

I've just done this instruction to install os.js and it's third-party package:

  1. git clone git@github.com:os-js/OS.js.git
  2. git checkout v3
  3. npm i
  4. npm i -S @osjs/xterm-application
  5. npm run package:discover
  6. npm run build
  7. npm run serve

Ref: https://github.com/os-js/osjs-xterm-application/issues/4

andersevenrud commented 6 years ago

I have not been able to reproduce, but I will try this on a separate computer tomorrow.

smrsan76 commented 6 years ago

I thinks it's better to provide some information about my env to help you reproduce this error. So, these are the info:

Linux Ubuntu v18.04 x86_64
node v11.0.0
npm v6.4.1
OS.js v3.0.0-alpha.27
osjs-cli v3.0.1
andersevenrud commented 6 years ago

@smrsan76 It just dawned on me.... I know what this is now. The errors are from failure to remove directories -- and these directories does not exist in v3.

I now remember that you initially checked out the v2 branch and probably built that -- which left some invalid files in the dist/ directory.

andersevenrud commented 6 years ago

@smrsan76 So the "fix" here is actually to remove the contents of dist/.