2017-01-27 25 views
1

道歉令人難以置信的無知。有史以來第一次以任何形式查看或嘗試編碼,所有這些都自然有點令人困惑和壓倒一切。第一次編碼和困惑 - 回聲

試圖保持它超級基本我試圖通過這篇文章合作,建立對亞馬遜回聲基本的東西 - 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安裝ALEXA --save-SDK

回報 NPM WARN ENOENT ENOENT:沒有這樣的文件或目錄,打開 '/Users/OwenLee/package.json' NPM WARN OwenLee沒有描述 npm WARN OwenLee沒有存儲庫字段。 npm WARN OwenLee沒有自述文件數據 npm WARN OwenLee沒有許可證字段。

在Mac上工作,所以真的不知道如何/在哪裏訪問這個,但假設這是我需要將文件移動到哪裏?

很抱歉寶寶基礎知識。只是試圖至少得到一腳在知道需要學習這東西,但我讀的一切似乎認爲我已經有一個編碼的工作知識:S

任何幫助將是真棒 - 公司。任何意見後,你可能會看到我會絆倒

謝謝!

oven121

+0

我想它想讓你在導航到[Fact Skill repository]的src /'目錄後運行'npm install --save alexa-sdk'命令(https://github.com/alexa/skill -sample-nodejs-fact),其中'package.json'文件應該是 – davedwards

回答

0

所以儘可能的目錄/Users/OwenLee/這將是一個Mac上的個人文件夾。您可以通過Finder在側欄中點擊Macintosh HD(或任何您命名的主硬盤驅動器)來訪問HDD的Root /。如果你打開一個新的終端窗口,它將成爲終端啓動的目錄。你應該能夠通過採用文件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//

祝你的節目,如果你無關這個線程任何疑問,請隨時給我私人消息,或創建一個新的問題,並標記我,讓我得到通知。

+0

非常感謝,真的有幫助!絕對初學者,所以真的很棒信息 – oven121

+0

我很樂意提供幫助。我剛開始編程時選擇了Java,所以我一直在那裏。 (: –