Comments (9)
From the configuration file, the problem may be that tedis is used on the front end
from tedis.
Developing a node program with typescript need @types/node
. Please confirm whether it is a problem in this aspect 😊
from tedis.
from tedis.
The problem might be the version of @types/node, i just added working examples of js
, es
, and ts
to the project.
You can refer to it or add "allowSyntheticDefaultImports": true
to your tsconfig.json
from tedis.
@dasoncheng I am trying to use tedis, and am writing in my service.ts
const tedis = new Tedis({
port: 6379,
host: "127.0.0.1"
});
but i am getting following error
ERROR TypeError: net_1.createConnection is not a function
at Tedis.Base (base.js:46)
at Tedis.Mixin (tools.js:20)
at new Tedis (tedis.js:30)
Can you please guide on the same?
from tedis.
@tejalbhujbal Can you provide more information, such as tsconfig, package.json
from tedis.
Yes sure.
tsconfig
{
"compileOnSave": true,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom"
]
}
}
package.json
{
"name": "admin-cli-update",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --ec true --port 4201",
"build": "ng build",
"gitbuild": "ng build --base /start-angular/myApp/master/dist/",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"myApp": "http-server ./dist"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/flex-layout": "^6.0.0-beta.17",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"angular5-csv": "^0.2.10",
"body-parser": "^1.17.2",
"bootstrap": "^3.3.7",
"chart.js": "^2.7.2",
"connect-redis": "^3.3.2",
"cookie-parser": "^1.4.3",
"core-js": "^2.4.1",
"cors": "^2.8.4",
"express": "^4.16.4",
"express-session": "^1.15.6",
"font-awesome": "^4.7.0",
"hiredis": "^0.5.0",
"html2canvas": "^1.0.0-alpha.12",
"http-server": "^0.11.1",
"jquery": "^3.3.1",
"jspdf": "^1.4.1",
"jspdf-autotable": "^2.3.5",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-charts": "^1.6.0",
"ng2-pdf-viewer": "^5.0.1",
"ngx-bootstrap": "2.0.5",
"primeng": "^6.0.0-alpha.2",
"redis": "^2.7.1",
"redis-typescript": "^0.1.2",
"request": "^2.83.0",
"rxjs": "^5.5.2",
"tedis": "^0.1.4",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "^1.7.2",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"@types/redis": "^2.8.8",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
},
"main": "karma.conf.js",
"keywords": [],
"author": "",
"description": ""
}
from tedis.
@dasoncheng I want to connect to redis from my angular 4 application, for that reason I am trying to use tedis from my service file as mentioned in first comment. But its not working.
I went through documentation and as described "Tedis write with typescript, it's the client of redis for nodejs, support asycn with ts and commonjs".
So can you please tell me the appropriate way to use tedis?
from tedis.
@tejalbhujbal tedis is a tool for nodejs, work as a service on back-end. example
from tedis.
Related Issues (20)
- Transaction will never complete HOT 1
- Tedis fork HOT 1
- uncaught exception: protocol tries to read unavailable data HOT 2
- Connect with a function instead of immediately HOT 5
- How to use mget with a variable of type array HOT 3
- EPIPE error HOT 7
- do we have support for modules?
- SET should accept more parameters
- [Question] How can i set de database number in my connection?
- [Question] How can i set de database number in my connection? HOT 1
- ERR_INVALID_ARG_TYPE The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received undefined HOT 6
- Still maintained? HOT 1
- A note on refining tedis
- [QUESTION] PROJECT MAINTANENCE HOT 1
- pool best practices HOT 2
- tedis.get has invalid return type?
- GEOPOS Command returns inappropriate information
- Update to use UUID V4
- Why does `mget` has two parameters?
- 当redis断连,写入命令会永远卡住
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tedis.