massCodeIO / assistant-alfred

25 stars 1 forks source link

Search from Alfred4 returns no result and promt error #1

Open LeslieLeung opened 2 years ago

LeslieLeung commented 2 years ago

Hi, I installed the v1.0.1 alfred workflow and it didn't work. Upon checking the debug log in Alfred, I found this:

[17:24:41.389] ERROR: massCode assistant[[Script Filter](alfredpreferences:workflows%3Eworkflow%3Euser.workflow.24F03A81-51F1-4536-9238-725411581965%3E177039CF-0717-4E00-9FE3-69F90DD802A6)] Code 1: node:internal/errors:465
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'conf' imported from /Users/x/Preferences/Alfred/Alfred.alfredpreferences/workflows/user.workflow.24F03A81-51F1-4536-9238-725411581965/node_modules/alfy/index.js
    at new NodeError (node:internal/errors:372:5)
    at packageResolve (node:internal/modules/esm/resolve:954:9)
    at moduleResolve (node:internal/modules/esm/resolve:1003:20)
    at defaultResolve (node:internal/modules/esm/resolve:1218:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
    at link (node:internal/modules/esm/module_job:78:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

I am not quite familiar with js, and I am new to Alfred, I am not sure if I messed anything up.

LeslieLeung commented 2 years ago

I found a way to fix this.

// cd to the directory of the workflow
cd /Users/x/Preferences/Alfred/Alfred.alfredpreferences/workflows/user.workflow.24F03A81-51F1-4536-9238-725411581965/
npm install

However the problem is within the .alfredworkflow, hope you can fix it soon.

enderwiggens commented 2 years ago

I found a way to fix this.

// cd to the directory of the workflow
cd /Users/x/Preferences/Alfred/Alfred.alfredpreferences/workflows/user.workflow.24F03A81-51F1-4536-9238-725411581965/
npm install

However the problem is within the .alfredworkflow, hope you can fix it soon.

This also fixed the issue for me. M1 Macbook Pro with Alfred v 5.0.1

paw-lu commented 2 years ago

hm, npm install in the directory did not fix it for me. Any additional steps I'm missing?

Screen Shot 2022-08-24 at 3 22 57 PM Screen Shot 2022-08-24 at 3 23 13 PM
LeslieLeung commented 2 years ago

hm, npm install in the directory did not fix it for me. Any additional steps I'm missing?

Screen Shot 2022-08-24 at 3 22 57 PM Screen Shot 2022-08-24 at 3 23 13 PM

Not sure if this is related, my node version is v16.15.1.

paw-lu commented 2 years ago

Good hint @LeslieLeung, upgraded mine to v18.8.0 and your workaround resolves the issue.

liusishan commented 1 year ago

I found a way to fix this.

// cd to the directory of the workflow
cd /Users/x/Preferences/Alfred/Alfred.alfredpreferences/workflows/user.workflow.24F03A81-51F1-4536-9238-725411581965/
npm install

However the problem is within the .alfredworkflow, hope you can fix it soon.

Thank you, this solved the problem for me. The path I found here. image

Josiah1 commented 1 year ago

Thank you, it also worked for me.