Reputation: 697
Maybe similar questions found but those are very old and recommending outdated plugins.
-I'm using eclipse Ide for enterprise java developers 2021-06 and installed Nodejs 16.3 and Npm.
As eclipse news
says, Eclipse Neon and later will support jnodejs by default and you can configure runtime but I don't see any runtime in javaScript section in preferences and any option related to nodeJs and JavaScript in import sections.
I tried to install nodeClipse plugin but encountered errors.
When I import nodeJs project as general project, I get this error.
C:\Users\Hamidreza Abroshan\Documents\workspace-spring-tool-suite-4-4.12.0.RELEASE.metadata.plugins\org.eclipse.wildwebdeveloper.embedder.node\node-v14.15.4-win-x64\node.exe index.js
D:\dclm\dclm-customer-interaction-worker\dclm\node_modules\grpc\src\grpc_extension.js:55
throw error;
^
Error: Failed to load gRPC binary module because it was not installed for the current system Expected directory: node-v83-win32-x64-unknown Found: [node-v93-win32-x64-unknown] This problem can often be fixed by running "npm rebuild" on the current system Original error: Cannot find module 'D:\dclm\dclm-customer-interaction-worker\dclm\node_modules\grpc\src\node\extension_binary\node-v83-win32-x64-unknown\grpc_node.node' Require stack:
**Note: I can run this project from command line successfully with npm run start. Thanks in advance.
Upvotes: 3
Views: 1610
Reputation: 697
I found this way, but if you found better way, please post your answer. First, import the app as general project E.G, file>import>general>existing project in to workSpace. Then, open project explorer view and find package.json. Write click on that and choose run configuration.
choose launch npm and create new configuration. Now, in npm command enter run start and in package.json file enter the file's address. Hit run and your app will run successfully. This config should be done for the first time and for later times, you can go to runAs and choose npm... If you can not find package.json, open Cmd and navigate to project root folder and type npm run start and it will download some dependencies and create package.json also.
Upvotes: 2