第一次编码和困惑 - Echo

问题描述 投票:0回答:1

为令人难以置信的无知道歉。第一次查看或尝试以任何形式进行编码,自然而然地有点困惑和不知所措。

试图让它保持超级基础 我正在尝试通过阅读本文为 Amazon Echo 构建一些基础的东西 - https://developer.amazon.com/blogs/post/Tx3DVGG0K0TPUGQ/updated-alexa-skills-kit-fact -模板一步一步的指导来建立一个事实技能

必须进行步骤 2.3

一旦您下载了源代码 [完成]、安装了节点并更新了 npm,您就可以安装 ASK-SDK 了。根据您的技能,将其安装在与 src/index.js 文件相同的目录中。将目录更改为技能的 src 目录,然后在命令行中键入:npm install --save alexa-sdk

我已将 SDK 移动到与源相同的文件夹中 - 在下载文件夹中。对将目录更改为与我的技能相同感到困惑。据我所知,还没有技能,所以不确定将它移动到哪里。

当输入 npm install --save alexa-sdk

退货 npm WARN enoent ENOENT:没有这样的文件或目录,打开'/Users/OwenLee/package.json' npm WARN OwenLee 没有描述 npm WARN OwenLee 没有存储库字段。 npm WARN OwenLee 没有 README 数据 npm WARN OwenLee 没有许可证字段。

在 Mac 上工作,所以真的不知道如何/在哪里访问它,但假设这是我需要将文件移动到的地方?

非常抱歉宝宝基础知识。只是想至少踏入大门,因为知道需要学习这些东西,但我阅读的所有内容似乎都假设我已经具备编码的工作知识:S

任何帮助都会很棒 - 公司。之后的步骤的任何建议你可能会看到我会绊倒

谢谢!!

烤箱121

node.js json amazon-web-services echo
1个回答
0
投票

至于目录

/Users/OwenLee/
,这将是您在 Mac 上的主文件夹。通过单击侧栏中的
/
(或您命名的主硬盘驱动器),可以通过Finder访问您的硬盘驱动器的根目录
Macintosh HD
。如果您打开一个新的终端窗口,它将是终端启动的目录。您应该可以通过获取文件
packages.json
来解决您的问题,该文件应该位于您将 SDK 下载到的任何位置,并将其放在您的主文件夹,然后重新运行命令。

现在,如果您真正投入,请不要让我改变主意,但是如果您完全没有编程经验,我建议您从比 Java 或 Javascript 更简单的东西开始。面向对象的语言对于初学者来说可能既复杂又难以掌握(我个人多年来一直在编写像 C 这样的本地语言,现在才开始理解 Java 的工作原理。)。

如果这是一个选项,我建议从您的 Mac 内置支持的语言开始。也许从 Bash 脚本或 Apple Script 开始,制作基本脚本来完成您认为在终端中手动完成的事情很乏味,或者通过制作一些基本程序来显示文本来了解 C 和 C++ 等处理器原生语言的基础知识运行,或者要求用户输入一些东西,然后说出他们输入的内容。最后,由于您使用的是 Mac,因此您可以在应用商店中免费获得 Xcode,它会自行配置,您可以使用它来了解 macOS 如何处理窗口,或许可以从制作一个带有几个按钮的基本程序窗口开始单击时会发生不同的事情。

如果你对我的建议感兴趣,你可以在这里找到一些关于 bash 脚本的信息:

https://linuxconfig.org/bash-scripting-tutorial
教程说它假设读者以前没有 Bash 的知识,并且大多数命令应该在你的内置 Bash 版本中正常工作Mac 的终端应用程序。

如果您对 C++ 更感兴趣,这是我用来学习编写它并了解母语如何工作的网站:

http://www.cplusplus.com/doc/tutorial/

最后是一个名为“Hello World”的基本 C++ 程序,编写这个程序并了解它的每个部分如何工作在某种程度上是 C/C++ 学生的入会仪式:

//HelloWorld.cpp the double slash tells the compiler and user that everything after it on this line is a comment, not code//

#include <iostream> //The octothorp '#' lets the compiler know it needs to use the library named inside the pointed brackets '</>' when it builds the programme. 'iostream' stands for In-Out Stream, and handles basic text, and basic processor commands//

using namespace std; //This line tells the compiler that any line that says to show text or ask the user to type something should use regular text and not a special format//

int main() //'int' stands for integer, any time you make a variable that contains only an integer you should put this in front of it's name, and 'main' is the name of the integer. The empty parentheses tells the compiler that this is a function, rather than a number//

{ //The open curly bracket '{' tells the compiler where the function starts

cout<<"Hello World"; //'cout' stands for 'character out' and is for showing basic text in the terminal window. The double pointy 'out' brackets '<<' tells the compiler that the text should be sent out of the programme rather than loaded into a variable, the text inside the quotes is what will be shown on the screen, and the semi colon tells the compiler where the command ends, it has to be put at the end of any command that is inside of a function//

return 0 //The command 'return' is for telling the compiler whether or not an error has occurred, 0 means the programme ran fine, 1 means something went wrong, either way the programme closes when it runs the command 'return'//

} //the closed curly bracket tells the compiler where the function ends//

祝你编程顺利,如果你有任何与此主题无关的问题,请随时私信我,或创建一个新问题并在其中标记我,以便我收到通知。

© www.soinside.com 2019 - 2024. All rights reserved.