第一次编码和混乱-回声



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

试图保持它的超基础性我试图通过阅读这篇文章为Amazon Echo构建一些基础性的东西-https://developer.amazon.com/blogs/post/Tx3DVGG0K0TPUGQ/updated-alexa-skills-kit-fact-template-step-by-step-guide-to-build-a-fact-skill

必须执行步骤2.3

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

我已经将SDK移到了与源代码下载文件夹相同的文件夹中。我对将目录更改为与我的技能相同感到困惑。据我所知,目前还没有技能,所以不确定该把它转移到哪里。

当键入npm install时--保存alexa sdk

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

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

非常抱歉宝宝的基本知识。我只是想至少迈出一步,因为我需要学习这些东西,但我读到的所有东西似乎都认为我已经掌握了编码的实用知识:S

任何帮助都将是可怕的-股份有限公司任何关于步骤的建议之后,你可能会看到我会在上绊倒

谢谢!!

oven121

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

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

如果这是一个选项,我建议从您的Mac内置支持的语言开始。也许可以从Bash脚本或Apple Script开始,制作基本的脚本来做你觉得在终端中手动操作很乏味的事情,或者了解像C&C++,通过制作一些基本程序来显示运行时的文本,或者要求用户键入一些内容,并说出他们键入的内容。最后,既然你在Mac上,你可以在应用商店免费获得Xcode,它会自我配置,你可以玩它来学习macOS如何处理窗口,也许可以从制作一个带有几个按钮的基本程序窗口开始,这些按钮在点击时可以做不同的事情。

如果你对我的建议感兴趣,你可以在这里找到一些关于bash脚本的信息:https://linuxconfig.org/bash-scripting-tutorial教程说,它假设读者以前不了解bash,大多数命令在Mac的终端应用程序中内置的bash版本中应该可以正常工作。

如果你对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//

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

最新更新