Test page for Netapp

Автор: | 16 марта, 2018

Original sourses — https://github.com/hosein2398/node-telegram-bot-api-tutorial

NPM — Node.js Package Manager

Download from offial web site — https://nodejs.org/en/ and install application.

Create project folder (just bot in my case) and create index.js file.

Now we need install node-telegram-bot-api but error occurs — there is no package.json

PS C:\Users\ia.shkonda\Documents\bot> npm install —save node-telegram-bot-api
npm WARN saveError ENOENT: no such file or directory, open ‘C:\Users\ia.shkonda\package.json’
npm WARN enoent ENOENT: no such file or directory, open ‘C:\Users\ia.shkonda\package.json’
npm WARN ia.shkonda No description
npm WARN ia.shkonda No repository field.
npm WARN ia.shkonda No README data
npm WARN ia.shkonda No license field.

+ node-telegram-bot-api@0.30.0
updated 1 package in 0.894s

So, we should initialize package.json and continue installation of plugins. Initialization:

PS C:\Users\ia.shkonda\Documents\bot> npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.

package name: (bot)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to C:\Users\ia.shkonda\Documents\bot\package.json:

{
«name»: «bot»,
«version»: «1.0.0»,
«description»: «»,
«main»: «index.js»,
«scripts»: {
«test»: «echo \»Error: no test specified\» && exit 1″
},
«author»: «»,
«license»: «ISC»
}

Is this ok? (yes)

And try again and see project folder content:

PS C:\Users\ia.shkonda\Documents\bot> npm install —save node-telegram-bot-api
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN bot@1.0.0 No description
npm WARN bot@1.0.0 No repository field.

+ node-telegram-bot-api@0.30.0
added 87 packages in 4.862s

 

 

 

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *