Eclipse Unable To Find Install Path Node Native

2019-06-08 09:21发布

问题:

I'm having the following issue debugging a sample javascript that interacts with an angular web application. What I'm trying to do is run the following demo script per the following url

http://www.protractortest.org/#/

when I execute via the command line "protractor conf.js" it works as expected everytime. I follow this guide

https://github.com/angelozerr/angularjs-eclipse/wiki/Protractor

to execute via eclipse IDE

however I can never debug the test script via the IDE. Eclipse always throw the following error when I set the "Node.js install" path to be "Native Node.js"

"Cannot find node install path node-native Do you want to update Protractor preferences?"

My Protractor settings in eclipse are the following:

  Node.js install: Native Node.js
  Native path: C:\Program Files\nodejs\node.exe
  Node.js path: C:\Program Files\nodejs\node.exe

which corresponds to the path where node is installed on my windows machine.

I had procmon running profiling when this popup appears and I spotted this oddity?

CreateFile|C:\Windows\System32\node-native|NAME NOT FOUND|Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a

I'm not sure why why node-native is going to the path? Would anyone would know how to resolve this issue i'm seeing so that I can debug a protractor script via Eclipse IDE?

**Btw the Eclipse IDE i'm using is**

Eclipse for JavaScript and Web Developers Version: Neon Release (4.6.0) Build id: 20160613-1800

**Node Install**

v4.4.7 x64

回答1:

If you are using a new version of protractor (3.2 or greater), the path for cli.js has changed. Change the path from: protractor/lib/cli.js to protractor/built/cli.js



回答2:

The solution is available here : https://github.com/angelozerr/angularjs-eclipse/issues/181

The solution is to install "Tern Debuggers". Run the conf.js file again with setting : Run in debug mode with "Start node.js in only run mode". It should work now.

I installed the add-ons for eclipse from: http://oss.opensagres.fr/angularjs-eclipse/1.3.0-SNAPSHOT/