【问题标题】:on Node.js command, Why am I getting error message "windows cannot find $. Make sure you've typed the name correctly..."在 Node.js 命令上,为什么我收到错误消息“windows 找不到 $。请确保您输入了正确的名称...”
【发布时间】:2017-12-13 13:25:12
【问题描述】:

我已经在我的 PC 上安装了 node js,并且想通过命令行运行脚本来测试 js 脚本。但是当我输入

start $ node testname

出现 Windows 错误警报并显示以下消息

windows 找不到 $。确保您输入的名称正确,然后 再试一次

请问有人知道我为什么会收到此错误消息吗?

【问题讨论】:

  • 您希望$ 做什么?
  • 我正在通过在线培训网站 (Lynda) 上观看教程在线学习 Node.js,并且在运行任何示例时,视频中始终使用“start $ node”。 start $ node ask.js start $ node ask
  • 你确定这个start $ node的东西真的是在教程的Windows命令提示符(cmd)中输入的吗?或者您可能会将其与 PowerShell 或某些 Unix shell 混淆?

标签: javascript node.js windows cmd


【解决方案1】:

只使用node testname 而不使用$

【讨论】:

  • 感谢您的回复。当我这样做时,我收到一条消息说找不到文件(节点文件)
  • @user2274299 您需要将node 可执行文件的路径添加到PATH 环境变量或在执行时使用绝对路径:C:/%path_to_node%/node testname
猜你喜欢
  • 1970-01-01
  • 2015-02-22
  • 1970-01-01
  • 2020-11-03
  • 2021-06-17
  • 1970-01-01
  • 2019-09-01
  • 1970-01-01
  • 2013-03-28
相关资源
最近更新 更多