Skip to content
Advertisement

change “node” command into “nodejs” on windows

I am working on a nodejs project that I got from a linux user and he asked me to change the node command to nodejs , and I am using a windows system.

So instead of node index.js I need nodejs index.js

I have tried the doskey command but it does not seem to work

    doskey nodejs=node

as I get just an arrow on the next line when I type in nodejs index.js

Does anyone have another workaround or way to do this , if there is one.

Advertisement

Answer

Create a batch file nodesjs.bat

@<path-to-node.exe>node.exe %*

and put the batch file into the path.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement