简体   繁体   English

bash:节点:找不到命令,但完整路径有效; 我怎样才能使“ node -v”工作? (node.js)

[英]bash: node: command not found, but full path is working; how can I make just “node -v” work? (node.js)

I just installed node.js. 我刚刚安装了node.js。 I tried to make sure it was installed by running 'node -v' but got the error "bash: node: command not found." 我试图确保通过运行'node -v'来安装它,但收到错误消息“ bash:node:command not found”。 I checked some answers here, and when I put in the full path "c:/dev/www.tctmd.com/node -v" it worked. 我在这里检查了一些答案,当我输入完整路径“ c:/dev/www.tctmd.com/node -v”时,它起作用了。

What I want to know is how do I fix it so that I can just type in "node" instead of "c:/dev/www.tctmd.com/node"? 我想知道的是如何解决此问题,以便仅输入“ node”而不是“ c:/dev/www.tctmd.com/node”? I'm currently in the /www.tctmd.com folder in my command shell. 我目前在命令外壳的/www.tctmd.com文件夹中。 Using Windows 7. 使用Windows 7。

这确实很愚蠢,但事实证明,我只需要关闭并重新打开命令行即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM