javascript - 我在 Windows 终端上执行 JavaScript 文件时遇到问题
问题描述
我是 node.js 的新手,我的代码没有执行。无论我在哪里搜索它,我都意识到代码具有正确的语法。当我直接在终端上运行此代码时,它正在执行,但是当我创建一个名为 hello.js 的文件然后执行时,它给了我错误。代码和错误分别如下:
console.log('hello world');
抛出:
node hello.js
SyntaxError: Unexpected identifier
解决方案
推荐阅读
- python - 如何对列表中给出的字典进行排序
- python - 为什么我无法使用列表对象语法并且遇到 AttributeError: when running my program
- excel - 从行中取出所有单元格直到第 31 列,然后循环到下一行
- amazon-web-services - 是否可以使用 gradle 命令在 aws 设备场上运行 appium 测试?
- c# - 移除立方体地形的隐藏顶点和三角形
- python - 我想在我的双摆中加入钟摆斑点
- javascript - 使用 Google 脚本将日历事件中的所有数据放入一行数据中
- c# - 无法将配置部分传递给 IServiceCollection.Configure
() 不再 - swift - 如何在 Swift 中检查 url 是否有效?
- javascript - 是否可以将两个 GraphQL 查询混合到一个查询中?