havardh / workflow

Workflow-centric workspace manager
154 stars 9 forks source link

Linux Installation: @jxa/run@^1.0.0 required by workflow-wm-osx prevents usage. #120

Closed LySofDev closed 6 years ago

LySofDev commented 6 years ago

Hello,

Attempting to install and use the application on Debian Linux with i3wm.

Linux Version: 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux Node Version: v8.11.1

Global installation of the package is successful yet the first run which creates the Workflow directory fails during the NPM installation process. Furthermore, attempting to use the application throws "Cannot find module ..." error for the first dependency. Inspecting the Workflow directory reveals that Node modules have not been installed.

Receiving the following error message on first use.

Running `npm install`
npm ERR! code E404
npm ERR! 404 Not Found: @jxa/run@^1.1.0

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/esteban/.npm/_logs/2018-08-31T18_21_54_491Z-debug.log
Error: Command failed: npm i

NPM log shows the following:

980 verbose stack Error: 404 Not Found: @jxa/run@^1.1.0
980 verbose stack     at fetch.then.res (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
980 verbose stack     at tryCatcher (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
980 verbose stack     at Promise._settlePromiseFromHandler (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
980 verbose stack     at Promise._settlePromise (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
980 verbose stack     at Promise._settlePromise0 (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
980 verbose stack     at Promise._settlePromises (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
980 verbose stack     at Async._drainQueue (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
980 verbose stack     at Async._drainQueues (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
980 verbose stack     at Immediate.Async.drainQueues (/home/esteban/.nvm/versions/node/v8.11.1/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
980 verbose stack     at runCallback (timers.js:794:20)
980 verbose stack     at tryOnImmediate (timers.js:752:5)
980 verbose stack     at processImmediate [as _immediateCallback] (timers.js:729:5)
981 verbose cwd /home/esteban/.workflow
982 verbose Linux 4.9.0-8-amd64
983 verbose argv "/home/esteban/.nvm/versions/node/v8.11.1/bin/node" "/home/esteban/.nvm/versions/node/v8.11.1/bin/npm" "i"
984 verbose node v8.11.1
985 verbose npm  v5.6.0
986 error code E404
987 error 404 Not Found: @jxa/run@^1.1.0
988 verbose exit [ 1, true ]

After some research, I'm under the impression that the JXA package relates to the execution of JS in a Mac OSX environment and should therefore be unrelated to a Linux environment. After inspecting the package.json and config.js files, it would seem this dependency cannot be removed or suprressed by configuration.

Please advise on how I could further contribute in the resolution of this issue.

havardh commented 6 years ago

Hi, thank you for taking the time too make a good bug report. :) :100:

I saw this issue earlier, but did not realize that it was blocking. It worked my my arch. The problem is the dependencies of workflow-wm-safari. It depends directly on workflow-wm-osx package and triggers the error which you have correctly diagnosed. The default package.json generated by workflow, or more specifically create-workflow-home, depends on workflow-apps-defaults which in turn depends on the Safari package. The direct dependency of the Safari package should have been a devDependency, and thus not required by the npm install you saw failing.

workaround

Remove the workflow-apps-defaults dependency in your WORKFLOW_HOME/package.json and replace it with actual packages like workflow-app-atom. You need too rewrite the flow files too Run npm install manually and you should be good to go.

Fix

Change the dependencies tag to being a devDependencies in the workflow-app-safari package json. And make sure that this is the only application with this issue.

Now if you want too make a PR for this I'd be delighted, but don't feel obligated too do so ;)

havardh commented 6 years ago

@LySofDev: workflow-apps-defaults@0.3.4 is released to solve this issue. Please run npm install workflow-apps-defaults@latest in your workflow-home and let me know how if it works :+1: