【问题标题】:The term 'node' is not recognized as the name of a cmdlet,术语“节点”未被识别为 cmdlet 的名称,
【发布时间】:2021-10-06 12:32:46
【问题描述】:

PS D:\javascripr\wen_shen_test_package> 节点hello.js 节点:术语“节点”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者是否包含路径 ded,验证路径是否正确,然后重试。 在 line:1 char:1

  • 节点hello.js
  •   + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    
    
    

请问,我能换什么?

【问题讨论】:

  • 你安装nodejs了吗?如果是,在您开始安装之前,那个特定的 powershell 终端是否已经打开?如果是,请将其关闭并打开一个新的 powershell,以便它能够获取更改后的 PATH 环境变量。

标签: node.js visual-studio-code


【解决方案1】:

你还没有在你的电脑上安装 node.js。 https://nodejs.org/en/download/

如果已经安装

1.在你的桌面上创建index.js文件并在里面添加这段代码:

a=2
b=3
console.log(a*b)
  1. shift+右键点击桌面,点击此处打开powershell窗口。

  2. 输入命令: 节点索引.js

它会显示a*b的值

上面给出的代码是如何使用节点访问特定 js 文件的示例

【讨论】:

  • 对不起,我已经检查到powershell,有版本
  • nnnnnn,我的代码是使用 console.log(hellow node);但不幸的是显示这个,
  • 把 hello node 消息放在 " " 里面,比如这个 console.log("hello node")
  • 是的,我尝试成功,我删除节点 64 并再次下载 32 ,是工作。
猜你喜欢
  • 1970-01-01
  • 2019-10-12
  • 2017-12-11
  • 2021-12-09
  • 2020-02-25
  • 2020-04-17
  • 2018-09-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多