Hi,
This is the first time I use Nodejs so please help me.
If I didn't git clone https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs.git and run npm install --save alexa-sdk, it return:
npm WARN saveError ENOENT: no such file or directory, open '/home/ntuankhoa/Project/java/javascripting/package.json'
/home/ntuankhoa/Project/java/javascripting
โโโฌ [email protected]
โโโฌ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โ โโโ [email protected]
โ โโโ [email protected]
โ โโโ [email protected]
โ โโโฌ [email protected]
โ โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
npm WARN enoent ENOENT: no such file or directory, open '/home/ntuankhoa/Project/java/javascripting/package.json'
npm WARN javascripting No description
npm WARN javascripting No repository field.
npm WARN javascripting No README data
npm WARN javascripting No license field.
if I git clone https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs.git and run npm install --save alexa-sdk, it return:
npm ERR! Linux 4.8.0-45-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "alexa-sdk"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ENOSELF
npm ERR! Refusing to install alexa-sdk as a dependency of itself
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/ntuankhoa/Project/java/javascripting/alexa-skills-kit-sdk-for-nodejs/npm-debug.log
would you mind helping me ?
In the first image, it appears you're attempting to save to a directory that does not exist. This means that your .json file is not referenced correctly in the path. In the second image you're trying to install the alexa sdk as a dependency of it's self, which basically means you've targeted the Alexa SDK in your path, and you're trying to install Alexa SDK into it. What code editor are you using?
Sorry, Michael was right. Not sure how I missed that first line.
Edit: Actually I think I am right; I'm sorry for flip-flopping. My comment was that the first time, there was no error - you simply don't have a package.json to save the dependency in. Therefore it has installed correctly, but not logged the dependency. Run npm init to make a package.json, if you want to log the dependency.
@knowlsie
Good catch. It's been awhile since I've developed with Node.js, picked it back up again solely for building out a skill with this SDK.
Hi @michaelborchardt , hi @knowlsie ,
So the 1st case is right ?
I ran npm init and it created package.json. After that , the warning only show
npm WARN [email protected] No description
npm WARN [email protected] No repository field
But it doesn't matter, right ?
Thank you for your help
Can you compile the file using node file.js? And what code editor are you using to build your files? That would help us debug your scenario.
Edit: dumb mistake
I'm sorry I mean, node file.js.
Hey @shaolinkhoa ,
I think you're on the right track! Those are warnings on your package "java" , I'd expect that you didn't fill in the description & repository fields when running npm init.
If you've ran npm install --save alexa-sdk on your [email protected] package directory, then npm should download the Alexa SDK and its dependencies to your node_modules folder.
Check out the NodeJS Trivia Skill Sample for some boilerplate code which uses the alexa-sdk module. ๐
Edit: Spelling
@shaolinkhoa
@bclement-amazon is entirely correct in the diagnosis of your issue. All though if you continue to have problems building and running your files, may I recommend you try using Visual Studio Code. It's a light-weight, code editor built by Microsoft, portable to every OS platform, and it's excellent when used with node. It has a built in console and everything you need to operate. Jet Brains also makes a great node IDE, but that may cost you more than you're willing to spend.
@michaelborchardt +1 for VSCode
They just had an impressive changelog today with their 1.11 update.
@bclement-amazon I've installed the update, haven't gone through the changelog extensively yet. All though I did take note of the node debugging features that they've updated/implemented. The team over at Microsoft who manages the project really does a phenomenal job, I've thought highly of the tool since beta.
I'm going to close this for now @shaolinkhoa , please let me know if you have any further questions
Hi @michaelborchardt , hi @bclement-amazon ,
I'm using ubuntu and just write code on sublime. I haven't learnt nodejs yet.
Would you mind if I ask some question ?
I made alexa echo on raspberry follow alexa-avs-sample-app and ran 2 projects followed 2 tutorials :
I have read code python in the quick start and code nodejs in particle-light but I can't find or understand the standard code to put in Lambda function code.
What I don't understand is how to code in _Lambda function code_ .
So I found Alexa Skills Kit SDK for Node.js.
thank you
Where did i18next and all the other dependencies go? This current build isn't working anymore and I'm getting all kinds of errors regarding i18next and many other files missing?