deltachat / deltachat-node

Email-based instant messaging for Node.js.
GNU General Public License v3.0
45 stars 11 forks source link

@types/node is missing on installation #422

Closed Simon-Laux closed 4 years ago

Simon-Laux commented 4 years ago

error on installing from npm in non typescript enviroment.

``` npm i deltachat-node > deltachat-node@1.0.0-beta.26 install [...]/node_modules/deltachat-node > tsc && node-gyp-build "node scripts/rebuild-core.js" "node scripts/postinstall.js" lib/chat.ts:3:17 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 3 const binding = require('../binding') ~~~~~~~ lib/chat.ts:4:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 4 const debug = require('debug')('deltachat:node:chat') ~~~~~~~ lib/chatlist.ts:3:17 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 3 const binding = require('../binding') ~~~~~~~ lib/chatlist.ts:6:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 6 const debug = require('debug')('deltachat:node:chatlist') ~~~~~~~ lib/contact.ts:3:17 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 3 const binding = require('../binding') ~~~~~~~ lib/contact.ts:4:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 4 const debug = require('debug')('deltachat:node:contact') ~~~~~~~ lib/deltachat.ts:5:30 - error TS2307: Cannot find module 'events'. 5 import { EventEmitter } from 'events' ~~~~~~~~ lib/deltachat.ts:12:18 - error TS2307: Cannot find module 'path'. 12 import path from 'path' ~~~~~~ lib/deltachat.ts:15:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 15 const debug = require('debug')('deltachat:node:index') ~~~~~~~ lib/deltachat.ts:102:10 - error TS2339: Property 'removeAllListeners' does not exist on type 'DeltaChat'. 102 this.removeAllListeners() ~~~~~~~~~~~~~~~~~~ lib/deltachat.ts:110:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 110 this.emit('ready') ~~~~ lib/deltachat.ts:122:10 - error TS2339: Property 'once' does not exist on type 'DeltaChat'. 122 this.once('_configured', ready) ~~~~ lib/deltachat.ts:329:20 - error TS2339: Property 'endsWith' does not exist on type 'string'. 329 const db = dir.endsWith('db.sqlite') ? dir : path.join(dir, 'db.sqlite') ~~~~~~~~ lib/deltachat.ts:616:13 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node`. 616 cwd = process.cwd() ~~~~~~~ lib/deltachat.ts:769:8 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 769 self.emit('ALL', event, data1, data2) ~~~~ lib/deltachat.ts:780:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 780 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:783:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 783 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:786:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 786 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:789:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 789 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:792:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 792 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:795:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 795 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:798:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 798 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:801:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 801 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:804:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 804 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:807:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 807 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:810:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 810 self.emit(eventStr, data2) ~~~~ lib/deltachat.ts:813:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 813 self.emit(eventStr, data1) ~~~~ lib/deltachat.ts:816:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 816 self.emit(eventStr, data1) ~~~~ lib/deltachat.ts:819:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 819 self.emit(eventStr, data1) ~~~~ lib/deltachat.ts:822:32 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 822 if (data1 === 1000) self.emit('_configured') ~~~~ lib/deltachat.ts:823:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 823 self.emit(eventStr, data1) ~~~~ lib/deltachat.ts:826:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 826 self.emit(eventStr, data1) ~~~~ lib/deltachat.ts:829:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 829 self.emit(eventStr, data1) ~~~~ lib/deltachat.ts:832:12 - error TS2339: Property 'emit' does not exist on type 'DeltaChat'. 832 self.emit(eventStr, data1, data2) ~~~~ lib/locations.ts:3:17 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 3 const binding = require('../binding') ~~~~~~~ lib/locations.ts:4:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 4 const debug = require('debug')('deltachat:node:locations') ~~~~~~~ lib/lot.ts:3:17 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 3 const binding = require('../binding') ~~~~~~~ lib/lot.ts:4:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for code? Try `npm i @types/node`. 4 const debug = require('debug')('deltachat:node:lot') ~~~~~~~ lib/message.ts:7:15 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`. 7 const debug = require('debug')('deltachat:node:message') ~~~~~~~ Found 39 errors. npm ERR! code ELIFECYCLE [...] ```

Solution

we just need to run npm i @types/node and push the result