zsh: command not found: sls - javascript

I am running a node js application with AWS.
This is server less application therefore when I am trying to install through this
https://www.serverless.com/plugins/serverless-offline
Things are working fine till here.. after that when I am trying to run sls offline I am getting this error.
zsh: command not found: sls
Can anybody help me what I am missing here. Also I have places all the access details of my AWS creads in AWS credentials.

Related

heroku login command doesn't exist

I was trying to create an app with Heroku. Following the docs, I ran heroku login, and heroku returned the following error:
! Invalid credentials provided.
» Warning: login is not a heroku command.
Did you mean join? [y/n]:
» Error: Run heroku help for a list of available commands.
! Command failed: heroku login
My Heroku Version is heroku-cli/7.0.9 win32-x64 node-v14.11.0. Any idea why this is happening, and how I can fix it?
My solution was to instead install it from npm, and then run heroku login which works.

Discord bot works fine hosted locally but if i try and host it on heroku it says "Error: Cannot find module 'discord.js'"

Discord bot works fine locally on discord server but when hosting on Heroku it says "Error: Cannot find module 'discord.js'"
what can I do to fix this? (first time making a discord bot)
I am not sure what to do to fix this so haven't tried anything other than checking the code
the code should be fine because it works on my discord server when I host it locally
but all the code is posted here (https://github.com/MathiasAC/team-skylo-discord-bot/tree/master/SkyloBotDiscord)
also, I have removed the bot token while I get help it's normally there
I expect it to be hosted on Heroku but it says "Error: Cannot find module 'discord.js'" even though discord.js in the bot folder and it works fine on my discord server locally hosted
You don't have discord.js in your dependencies within package.json.
Run:
npm install discord.js --save
Then push it to Heroku.

Syntaxerror: Unexpected Token , in Hawk (fresh npn install)

I am in the process of learning Nodejs and WebRPC. I am for all intents and purposes, a novice.
I installed the Plivo (http://plivo.com) API for nodejs and when attempting to run it I had an issue with Const which I resolved by running my test file with --harmony appended to the start of the command, after this I have gained the error
Syntaxerror: Unexpected token ,
This error falls on line 506 of
\hawk\lib\server.js
The relevant section of code is;
const artifacts = {
ts: authorization.ts,
nonce: authorization.nonce,
host,
port,
hash: authorization.hash
};
line 506 is host,
I do not see the problem.
At this point, all I am trying to do is initialise the plivo API. I have no other calls to it.
I have deleted the hawk folder and done a fresh npm install hawk, can anyone else suggest anything?
edit:
As of writing the post, I attempted to load hawk directly in a script rather than as a dependency through plivo. It still brings up the same error so it won't be a problem with plivo.
Edit 2.
Seems it was a versioning issue. My system had v0.12 installed. I attempted to update it twice, both times the install went back to v0.12 despite uninstalling it first.
Cleared appdata\roaming\npm and appdata\roaming\npm-cache as well as deleting any remaining node files in "c:\program files" before reinstalling. I now have 8.x installed and the syntax error is no longer showing.
Thanks
Ken

Node.JS: Why is my connection to localhost:3000 refused?

I'm a student going into back-end development for the first time and are trying to learn Node.JS. I downloaded a pdf book about Node.JS from sitepoint called: "Jumpstart Node.JS". In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000, i got nothing except the following message: "Connection refused: localhost:3000", Can somebody please tell me what might have went wrong and how to fix it?
Edit1:
The instructions i followed is about setting up a node.js server using the Node command line, thus no code, simply cmd commands, however, here is a quick summary of the process i followed:
Created an account on MongoLabs and then a database using the free pricing plan.
Installed express using the command: npm install -g express#.2.5.8.
Created an applications with default options using this command: express authentication.
modified the package.json file in system32
installed the dependencies by typing cd authentication, hitting enter, and then typing the command: npm install
Typed node app and hit enter.
According to the instructions i should have seen a message: "Welcome to express" but instead got the error message.
In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000
It seems that you didn't start the server.
Somewhere between installing the dependencies and navigating to the URL you need to actually start the server if you want it to serve the request.
Check that there is no copy of the server running in the background, or that another app is using the port currently.
(Your firewall show allow you to see which app has been allocated to that port)
Because nodejs requires it to be the only app on that port running on your computer.
Also try a different port maybe?

Node.js sails.js pm2 ec2 instance error due to memory

I am currently running a basic website on an amazon EC2 t1.micro instance.
The application is built using sails.js / node.js and is booted up using pm2.
After a while I get the following message in the errors log file and the server crashes:
FATAL ERROR: Committing semi space failed. Allocation failed - process out of memory
Could somebody help me with this issue?
Have I misconfigured something?
I am running:
Node version 5.9.0
NPM 3.7.3

Categories

Resources