I'm new to Nodejs and I downloaded this code and I can't start it, I've already been working with other projects and they work fine (install the express and the cli, in addition to the node-telegram-bot-api as it says on gitHub) what could I be missing? the code is in the repository: https://github.com/yagop/node-telegram-bot-api
The command:
looks in package.json for a script named "start" to execute the associated action. In this case, package.json doesn't contain a definition of "start" and that's why it gives you this error.
It seems that the project you want to use is a library to be used from another program, and cannot be run by itself.
As they say, you have several ways, those mentioned above and another one. I'm going to make a little guide to install the software, check the versions and run a script.
INSTALLING NODE AND NPM
Note that for a script that uses npm libraries to work you have to have:
CHECK NODE AND NPM VERSIONS
Once installed, we can check the version we have:
From node:
From npm:
For example, I have:
RUN NODEJS SCRIPT
There are 3 ways to run a node script via terminal.
1. Run via npm start telling it which file:
2.
package.json
Define the field in the filescript
:And run with:
3. Run the script via the node command:
Specifically, in the case of the yagop API it would be:
in addition to npm start you must put the name of the .js file you want to start, eg: npm start app.js