Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error on windows #45

Closed
ryudice opened this issue Aug 26, 2020 · 6 comments
Closed

Installation error on windows #45

ryudice opened this issue Aug 26, 2020 · 6 comments

Comments

@ryudice
Copy link

ryudice commented Aug 26, 2020

I'm getting this error when running on windows:

`(node:3812) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, copyfile 'null/app.asar' -> 'null/app.asar.backup'
    at Object.copyFileSync (fs.js:1941:3)
    at Object.exports.apply (C:\Users\Administrator\AppData\Roaming\npm\node_modules\mtslack\lib\command.js:89:6)
    at Object.exports.selectTheme (C:\Users\Administrator\AppData\Roaming\npm\node_modules\mtslack\lib\command.js:126:8)
    at Object.exports.change (C:\Users\Administrator\AppData\Roaming\npm\node_modules\mtslack\lib\command.js:117:8)
    at exports.execute (C:\Users\Administrator\AppData\Roaming\npm\node_modules\mtslack\lib\command.js:132:12)
    at run (C:\Users\Administrator\AppData\Roaming\npm\node_modules\mtslack\main.js:27:3)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async AutoUpdate.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\mtslack\main.js:55:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3812) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3812) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.`
@mallowigi
Copy link
Collaborator

Please make sure you have the latest version installed

@ryudice
Copy link
Author

ryudice commented Sep 1, 2020

I had the latest version but apparantly this doesnt work with the microsoft store version of slack, probably because it is installed in a different directory

@anebz
Copy link

anebz commented Nov 10, 2020

I don't have the microsoft version of slack and I get the same error, I heard in similar issues it might be because of Electron-DB?

@mallowigi mallowigi reopened this Nov 10, 2020
@jlevier
Copy link

jlevier commented Nov 10, 2020

I was able to fix this locally on a Windows 10 install. The problem I saw is that this is due to the latest version number of slack and how the code resolves the slack directory. On Windows 10, the directory the code wants to find is C:\Users\my_user\AppData\Local\slack\app-4.10.3. However, if you look at how the code resolves this directory, it only supports up to versions app-4.9.x. The code is found in /lib/consts.js method getWindowsDirectory():

function getWindowsDirectory() {
  for (let i = 9; i >= 0; --i) {
    for (let j = 9; j >= 0; --j) {
      const ver = `4.${i}.${j}`;

Locally I changed this code to the following and was able to run mtslack again on Windows 10:

function getWindowsDirectory() {
  for (let i = 11; i >= 0; --i) {
    for (let j = 11; j >= 0; --j) {
      const ver = `4.${i}.${j}`;

Thanks for the work on this project, @mallowigi. I stare at slack so much throughout the day and am grateful for this awesome theme solution!

@mallowigi
Copy link
Collaborator

Makes sense. I'd appreciate if you could make a pr.

@anebz
Copy link

anebz commented Nov 19, 2020

Just for completing @jlevier's solution, the mtslack installation is usually in C:\Users\USER\AppData\Roaming\npm\node_modules where USER is your Windows username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants