Node trying to find modules in the wrong folder
See original GitHub issueJust installed my plugin (search npm) from the plugin store and when I type the action keyword it shows this error:
Flow Launcher version: 1.9.4
OS Version: Microsoft Windows NT 10.0.19043.0
IntPtr Length: 8
x64: True
Python Path:
Date: 08/04/2022 11:23:38
Exception:
System.IO.InvalidDataException: Search npm|node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'C:\Users\user\AppData\Roaming\FlowLauncher\Plugins\Search'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 288
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.ExecuteAsync(ProcessStartInfo startInfo, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 302
at Flow.Launcher.Core.Plugin.JsonRPCPlugin.QueryAsync(Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\JsonRPCPlugin.cs:line 322
at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 192
--- End of stack trace from previous location ---
at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 34
at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 191
at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass137_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 613
--- End of stack trace from previous location ---
at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 587
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
I think the important line here is Error: Cannot find module 'C:\Users\user\AppData\Roaming\FlowLauncher\Plugins\Search'
. While the folder name is “Search npm-1.0.1”, node is trying to find modules in “Search”, not finding them and throwing this error.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
node.js - Cannot find module is looking in a wrong directory
Can you try to install nodemon in your current package.json using : npm i --save nodemon. Then change your start script to
Read more >Solving Path Problem - Running NPM modules/packages in ...
Computer looking to execute npm packages from wrong directory; Solved by adding\editing order of Windows environment variables in Control Panel.
Read more >Error: cannot find module [Node npm Error Solved]
When you get the “cannot find module” error, or “module not found”, it means you've not installed the package you're trying to use....
Read more >Resolving "Cannot find module" Error in Node.js
If the module you're trying to access is not located in the current directory or the node_modules directory, Node.js won't be able to...
Read more >require.resolve "Error: Cannot find module" even though ...
I have tried deleting the package folder and forcing a cache clean. Code to demonstrate: cd C:\src\nr\data npm remove startbootstrap-sb-admin-2 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No Problem. Is the script from the document? We should fix it.
It works, thank you