First time using node.js - “ReferenceError: node is not defined”

后端 未结 7 1951
刺人心
刺人心 2021-02-01 02:47

I just installed node.js. I tried writing node -v that should check the version - and it\'s not working. this is the output:

 > node -v ReferenceError: node          


        
7条回答
  •  鱼传尺愫
    2021-02-01 03:29

    Thanks for this help.

    If you are using windows, like me, and want a desktop shortcut and you already have the nice node.js desktop icon, edit the shortcut properties like this:

    1. right click and select properties
    2. click change Icon, select the current icon and click OK (to lock it in)
    3. in the target box, change it all to simply say cmd or c:\windows\System32\cmd.exe if you are pedantic.

    now you have a command prompt, with the node.js icon, that opens in the folder you expect, that responds correctly to the node -v command.

提交回复
热议问题