matthiasblaesing commented on issue #8261:
URL: https://github.com/apache/netbeans/issues/8261#issuecomment-2727437896

   @junichi11 could you please check if the problem is still reproducible?
   
   I tested on current master and I could reproduce the error, when I modified 
the code like this:
   
   ```diff
   --- 
a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptLSP.java
   +++ 
b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptLSP.java
   @@ -63,6 +63,7 @@
            }
            File server = 
InstalledFileLocator.getDefault().locate("typescript-lsp/node_modules/typescript-language-server/lib/cli.mjs",
 "org.netbeans.modules.typescript.editor", false);
            try {
   +            server = new File(server.getParent(), "cli2.mjs");
                Process p = new ProcessBuilder(new String[] {node, 
server.getAbsolutePath(), 
"--stdio"}).directory(server.getParentFile().getParentFile()).redirectError(ProcessBuilder.Redirect.INHERIT).start();
                return LanguageServerDescription.create(p.getInputStream(), 
p.getOutputStream(), p);
            } catch (IOException ex) {
   ```
   
   With that I get the error you already reported and in the log I see further:
   
   ```
   node:internal/modules/cjs/loader:1148
     throw err;
     ^
   
   Error: Cannot find module 
'/home/matthias/src/netbeans/nbbuild/netbeans/webcommon/typescript-lsp/node_modules/typescript-language-server/lib/cli2.mjs'
       at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
       at Module._load (node:internal/modules/cjs/loader:986:27)
       at Function.executeUserEntryPoint [as runMain] 
(node:internal/modules/run_main:174:12)
       at node:internal/main/run_main_module:28:49 {
     code: 'MODULE_NOT_FOUND',
     requireStack: []
   }
   
   Node.js v20.16.0
   ```
   
   The error makes sense in this case as the target is indeed not found. But if 
that is the origin of the problem, there are two options how to get there:
   
   - broken test setup. If `cli.mjs` is not present, that could explain the 
problem, but that file comes bundled with NB
   - broken node setup. The updated typescript language server (#7732) requires 
node 10, a setup with lower node version might result in this
   
   So could you check whether this was a one-time problem or if you can still 
reproduce it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to