如何在Angle Service.ts文件中导入节点模块

时间:2018-12-16 04:53:08

标签: node.js angular redis

我正在尝试在我的角度应用程序的data.service.ts文件中实现redis功能,以便我可以将其用于注册和登录页面,但每次我尝试

import { redisImport } from '../../node_modules/redis';
import { cryptoImport } from '../../node_modules/crypto-browserify';

从我的data.service.ts文件中,它给我诸如

的错误
ERROR in ./node_modules/redis-parser/lib/hiredis.js
Module not found: Error: Can't resolve 'hiredis' in '/Users/myname/Desktop/Website/node_modules/redis-parser/lib'
ERROR in ./node_modules/redis/index.js
Module not found: Error: Can't resolve 'net' in '/Users/myname/Desktop/Website/node_modules/redis'
ERROR in ./node_modules/browserify-sign/browser/index.js
Module not found: Error: Can't resolve 'stream' in '/Users/myname/Desktop/Website/node_modules/browserify-sign/browser'
ERROR in ./node_modules/cipher-base/index.js
Module not found: Error: Can't resolve 'stream' in '/Users/myname/Desktop/Website/node_modules/cipher-base'
ERROR in ./node_modules/hash-base/index.js
Module not found: Error: Can't resolve 'stream' in '/Users/myname/Desktop/Website/node_modules/hash-base'
ERROR in ./node_modules/redis/index.js
Module not found: Error: Can't resolve 'tls' in '/Users/myname/Desktop/Website/node_modules/redis'

0 个答案:

没有答案