I already have node installed in my machine and it was working fine. when I do node -v
it is displaying
The node identifier for {My machine name} is {some alphanumeric value}.
I used the node.js command prompt, instead of the windows default command prompt and it worked for me. Did not know why it did’t work in the windows default command prompt.
Solution
It is a straightforward answer for this solution but make make sure , have you installed node.js in your machine.
Approach: 1
I have installed CA Harvest software, Which has conflict with node.exe.
Finally, I found a very simple and straightforward answer without breaking my Harvest SCM by removing it from the path. I tried this, open your windows command line (cmd) and then pass the following nodejs batch file so that it will set your command line to the environment. Enjoy the node commands there.
- Open a terminal window in your project, first type cmd and hit enter to make sure the windows version
- Pass NodeJS batch file “C:\Program Files\nodejs\nodevars.bat” (if the bat file path is not correct please check it where it is exactly installed in your machine) and hit enter again to set as node.js environment
- Say npm start to run the application
Please see the below image for more information to set the command prompt for NodeJs environment
Approach: 2
Editing the path variable will solve the issue as explained in the answer below
Steps to resolve:
Windows
- Navigate to Start > Computer > Right-click Properties > Advanced system settings
- Under the Advanced tab, select Environment Variables
- Under System variables, select “Path” variable
- Find nodejs EXE, usually “C:\Program Files (x86)\nodejs\”
- Cut and paste this to the beginning of the “Path” variable. Ensure the paths are separated by a “;“
Conclusion
If we Installed CA Harvest software which will conflict with node.exe. so, without breaking our Harvest SCM we pass the following nodejs batch file, or Editing the path variable will solve the issue as we explained in the solution section, we hope you find them helpful.