我一直在尝试在Heroku上部署一个区块链应用程序,它是用JavaScript编写的,包括node.js、redis和React。虽然该应用程序在本地端口上完全可用,但当我在终端中运行heroku logs--tail时,我收到了一个复杂的错误。这是一个错误(我知道它在一个代码片段中,但我觉得这会让它更可读(:
2021-07-01T03:17:24.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.06 sample#load-avg-5m=0.095 sample#load-avg-15m=0.155 sample#read-iops=0 sample#write-iops=0.061111 sample#memory-total=15628992kB sample#memory-free=7494260kB sample#memory-cached=4526852kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:20:45.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.18 sample#load-avg-5m=0.15 sample#load-avg-15m=0.165 sample#read-iops=0 sample#write-iops=0.061111 sample#memory-total=15628992kB sample#memory-free=7494860kB sample#memory-cached=4527028kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:21:21.001119+00:00 app[api]: @ref:redis-concave-32605 completed provisioning, setting HEROKU_REDIS_GREEN_TLS_URL, HEROKU_REDIS_GREEN_URL. by user heroku-redis@addons.heroku.com
2021-07-01T03:21:21.001119+00:00 app[api]: Release v6 created by user heroku-redis@addons.heroku.com
2021-07-01T03:21:21.273031+00:00 heroku[web.1]: State changed from crashed to starting
2021-07-01T03:21:29.684446+00:00 heroku[web.1]: Starting process with command `npm start`
2021-07-01T03:21:31.855988+00:00 app[web.1]:
2021-07-01T03:21:31.856000+00:00 app[web.1]: > cryptochain@1.0.0 start /app
2021-07-01T03:21:31.856001+00:00 app[web.1]: > npm run build-client & node index.js
2021-07-01T03:21:31.856001+00:00 app[web.1]:
2021-07-01T03:21:32.268523+00:00 app[web.1]:
2021-07-01T03:21:32.268547+00:00 app[web.1]: > cryptochain@1.0.0 build-client /app
2021-07-01T03:21:32.268549+00:00 app[web.1]: > npm run clean && parcel build client/src/index.html --out-dir client/dist
2021-07-01T03:21:32.268549+00:00 app[web.1]:
2021-07-01T03:21:32.539039+00:00 app[web.1]: listening at localhost: 39994
2021-07-01T03:21:32.565995+00:00 heroku[web.1]: State changed from starting to up
2021-07-01T03:21:32.573200+00:00 app[web.1]: events.js:352
2021-07-01T03:21:32.573202+00:00 app[web.1]: throw er; // Unhandled 'error' event
2021-07-01T03:21:32.573203+00:00 app[web.1]: ^
2021-07-01T03:21:32.573203+00:00 app[web.1]:
2021-07-01T03:21:32.573204+00:00 app[web.1]: Error: self signed certificate in certificate chain
2021-07-01T03:21:32.573205+00:00 app[web.1]: at TLSSocket.onConnectSecure (_tls_wrap.js:1514:34)
2021-07-01T03:21:32.573205+00:00 app[web.1]: at TLSSocket.emit (events.js:375:28)
2021-07-01T03:21:32.573205+00:00 app[web.1]: at TLSSocket._finishInit (_tls_wrap.js:936:8)
2021-07-01T03:21:32.573206+00:00 app[web.1]: at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:708:12)
2021-07-01T03:21:32.573206+00:00 app[web.1]: Emitted 'error' event on RedisClient instance at:
2021-07-01T03:21:32.573207+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:342:14)
2021-07-01T03:21:32.573208+00:00 app[web.1]: at TLSSocket.<anonymous> (/app/node_modules/redis/index.js:223:14)
2021-07-01T03:21:32.573208+00:00 app[web.1]: at TLSSocket.emit (events.js:375:28)
2021-07-01T03:21:32.573209+00:00 app[web.1]: at emitErrorNT (internal/streams/destroy.js:106:8)
2021-07-01T03:21:32.573209+00:00 app[web.1]: at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-07-01T03:21:32.573210+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:82:21) {
2021-07-01T03:21:32.573210+00:00 app[web.1]: code: 'SELF_SIGNED_CERT_IN_CHAIN'
2021-07-01T03:21:32.573210+00:00 app[web.1]: }
2021-07-01T03:21:32.589313+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-07-01T03:21:32.589692+00:00 app[web.1]: npm ERR! errno 1
2021-07-01T03:21:32.597238+00:00 app[web.1]: npm ERR! cryptochain@1.0.0 start: `npm run build-client & node index.js`
2021-07-01T03:21:32.597381+00:00 app[web.1]: npm ERR! Exit status 1
2021-07-01T03:21:32.597530+00:00 app[web.1]: npm ERR!
2021-07-01T03:21:32.597660+00:00 app[web.1]: npm ERR! Failed at the cryptochain@1.0.0 start script.
2021-07-01T03:21:32.597765+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-07-01T03:21:32.607254+00:00 app[web.1]:
2021-07-01T03:21:32.607445+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-07-01T03:21:32.607578+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-07-01T03_21_32_598Z-debug.log
2021-07-01T03:21:32.687486+00:00 heroku[web.1]: Process exited with status 1
2021-07-01T03:21:32.965635+00:00 heroku[web.1]: State changed from up to crashed
2021-07-01T03:21:33.105392+00:00 heroku[web.1]: State changed from crashed to starting
2021-07-01T03:21:42.791340+00:00 heroku[web.1]: Starting process with command `npm start`
2021-07-01T03:21:45.092457+00:00 app[web.1]:
2021-07-01T03:21:45.092477+00:00 app[web.1]: > cryptochain@1.0.0 start /app
2021-07-01T03:21:45.092477+00:00 app[web.1]: > npm run build-client & node index.js
2021-07-01T03:21:45.092478+00:00 app[web.1]:
2021-07-01T03:21:45.463251+00:00 app[web.1]:
2021-07-01T03:21:45.463258+00:00 app[web.1]: > cryptochain@1.0.0 build-client /app
2021-07-01T03:21:45.463259+00:00 app[web.1]: > npm run clean && parcel build client/src/index.html --out-dir client/dist
2021-07-01T03:21:45.463259+00:00 app[web.1]:
2021-07-01T03:21:45.896194+00:00 app[web.1]: listening at localhost: 23780
2021-07-01T03:21:45.929244+00:00 app[web.1]: events.js:352
2021-07-01T03:21:45.929246+00:00 app[web.1]: throw er; // Unhandled 'error' event
2021-07-01T03:21:45.929247+00:00 app[web.1]: ^
2021-07-01T03:21:45.929247+00:00 app[web.1]:
2021-07-01T03:21:45.929248+00:00 app[web.1]: Error: self signed certificate in certificate chain
2021-07-01T03:21:45.929248+00:00 app[web.1]: at TLSSocket.onConnectSecure (_tls_wrap.js:1514:34)
2021-07-01T03:21:45.929249+00:00 app[web.1]: at TLSSocket.emit (events.js:375:28)
2021-07-01T03:21:45.929249+00:00 app[web.1]: at TLSSocket._finishInit (_tls_wrap.js:936:8)
2021-07-01T03:21:45.929250+00:00 app[web.1]: at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:708:12)
2021-07-01T03:21:45.929250+00:00 app[web.1]: Emitted 'error' event on RedisClient instance at:
2021-07-01T03:21:45.929251+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:342:14)
2021-07-01T03:21:45.929252+00:00 app[web.1]: at TLSSocket.<anonymous> (/app/node_modules/redis/index.js:223:14)
2021-07-01T03:21:45.929252+00:00 app[web.1]: at TLSSocket.emit (events.js:375:28)
2021-07-01T03:21:45.929252+00:00 app[web.1]: at emitErrorNT (internal/streams/destroy.js:106:8)
2021-07-01T03:21:45.929253+00:00 app[web.1]: at emitErrorCloseNT (internal/streams/destroy.js:74:3)
2021-07-01T03:21:45.929254+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:82:21) {
2021-07-01T03:21:45.929254+00:00 app[web.1]: code: 'SELF_SIGNED_CERT_IN_CHAIN'
2021-07-01T03:21:45.929254+00:00 app[web.1]: }
2021-07-01T03:21:45.947602+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-07-01T03:21:45.948090+00:00 app[web.1]: npm ERR! errno 1
2021-07-01T03:21:45.955537+00:00 app[web.1]: npm ERR! cryptochain@1.0.0 start: `npm run build-client & node index.js`
2021-07-01T03:21:45.955725+00:00 app[web.1]: npm ERR! Exit status 1
2021-07-01T03:21:45.955899+00:00 app[web.1]: npm ERR!
2021-07-01T03:21:45.956021+00:00 app[web.1]: npm ERR! Failed at the cryptochain@1.0.0 start script.
2021-07-01T03:21:45.956142+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-07-01T03:21:45.966534+00:00 app[web.1]:
2021-07-01T03:21:45.966744+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-07-01T03:21:45.966868+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-07-01T03_21_45_956Z-debug.log
2021-07-01T03:21:45.968683+00:00 app[web.1]:
2021-07-01T03:21:45.968684+00:00 app[web.1]: > cryptochain@1.0.0 clean /app
2021-07-01T03:21:45.968684+00:00 app[web.1]: > rm -rf .cache client/dist
2021-07-01T03:21:45.968684+00:00 app[web.1]:
2021-07-01T03:21:46.031029+00:00 heroku[web.1]: Process exited with status 1
2021-07-01T03:21:46.260925+00:00 heroku[web.1]: State changed from starting to crashed
2021-07-01T03:23:24.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.255 sample#load-avg-5m=0.27 sample#load-avg-15m=0.335 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6169772kB sample#memory-cached=4894636kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:23:37.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.07 sample#load-avg-5m=0.185 sample#load-avg-15m=0.29 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6173652kB sample#memory-cached=4894796kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:23:58.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.195 sample#load-avg-5m=0.18 sample#load-avg-15m=0.175 sample#read-iops=0 sample#write-iops=0.058333 sample#memory-total=15628992kB sample#memory-free=7491456kB sample#memory-cached=4527088kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:26:51.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.245 sample#load-avg-5m=0.205 sample#load-avg-15m=0.27 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6172740kB sample#memory-cached=4894916kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:27:07.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.115 sample#load-avg-5m=0.155 sample#load-avg-15m=0.17 sample#read-iops=0 sample#write-iops=0.061111 sample#memory-total=15628992kB sample#memory-free=7491408kB sample#memory-cached=4527152kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:30:25.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.19 sample#load-avg-5m=0.15 sample#load-avg-15m=0.16 sample#read-iops=0 sample#write-iops=0.0625 sample#memory-total=15628992kB sample#memory-free=7495212kB sample#memory-cached=4527332kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:33:22.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.165 sample#load-avg-5m=0.175 sample#load-avg-15m=0.245 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6170000kB sample#memory-cached=4895204kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:33:38.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.225 sample#load-avg-5m=0.175 sample#load-avg-15m=0.165 sample#read-iops=0 sample#write-iops=0.061111 sample#memory-total=15628992kB sample#memory-free=7494848kB sample#memory-cached=4527372kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:36:40.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.17 sample#load-avg-5m=0.165 sample#load-avg-15m=0.225 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6168372kB sample#memory-cached=4895496kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:36:55.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.04 sample#load-avg-5m=0.13 sample#load-avg-15m=0.15 sample#read-iops=0 sample#write-iops=0.066667 sample#memory-total=15628992kB sample#memory-free=7494652kB sample#memory-cached=4527420kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:39:54.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.115 sample#load-avg-5m=0.145 sample#load-avg-15m=0.2 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6170228kB sample#memory-cached=4895536kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:40:12.000000+00:00 app[heroku-redis]: source=REDIS addon=redis-opaque-73806 sample#active-connections=1 sample#load-avg-1m=0.07 sample#load-avg-5m=0.11 sample#load-avg-15m=0.135 sample#read-iops=0 sample#write-iops=0.058333 sample#memory-total=15628992kB sample#memory-free=7494864kB sample#memory-cached=4527596kB sample#memory-redis=333720bytes sample#hit-rate=1 sample#evicted-keys=0
2021-07-01T03:43:09.000000+00:00 app[heroku-redis]: source=HEROKU_REDIS_GREEN addon=redis-concave-32605 sample#active-connections=1 sample#load-avg-1m=0.14 sample#load-avg-5m=0.125 sample#load-avg-15m=0.18 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15628108kB sample#memory-free=6166928kB sample#memory-cached=4895824kB sample#memory-redis=333688bytes sample#hit-rate=1 sample#evicted-keys=0
以下是错误似乎涉及的文件:
//pubsub.js
const redis = require('redis');
const CHANNELS = {
TEST: 'TEST',
BLOCKCHAIN: 'BLOCKCHAIN',
TRANSACTION: 'TRANSACTION'
};
class PubSub {
constructor({ blockchain, transactionPool, redisUrl }) {
this.blockchain = blockchain;
this.transactionPool = transactionPool;
this.publisher = redis.createClient(redisUrl);
this.subscriber = redis.createClient(redisUrl);
this.subscribeToChannels();
this.subscriber.on(
'message',
(channel, message) => this.handleMessage(channel, message)
);
}
handleMessage(channel, message) {
console.log(`Message received. Channel: ${channel}. Message: ${message}.`);
const parsedMessage = JSON.parse(message);
switch(channel) {
case CHANNELS.BLOCKCHAIN:
this.blockchain.replaceChain(parsedMessage, true, () => {
this.transactionPool.clearBlockchainTransactions({
chain: parsedMessage
});
});
break;
case CHANNELS.TRANSACTION:
this.transactionPool.setTransaction(parsedMessage);
break;
default:
return;
}
}
subscribeToChannels() {
Object.values(CHANNELS).forEach(channel => {
this.subscriber.subscribe(channel);
});
}
publish({ channel, message }) {
this.subscriber.unsubscribe(channel, () => {
this.publisher.publish(channel, message, () => {
this.subscriber.subscribe(channel);
});
});
}
broadcastChain() {
this.publish({
channel: CHANNELS.BLOCKCHAIN,
message: JSON.stringify(this.blockchain.chain)
});
}
broadcastTransaction(transaction) {
this.publish({
channel: CHANNELS.TRANSACTION,
message: JSON.stringify(transaction)
});
}
}
module.exports = PubSub;
//index.js
const bodyParser = require('body-parser');
const express = require('express');
const request = require('request');
const path = require('path');
const Blockchain = require('./blockchain');
const PubSub = require('./app/pubsub');
const TransactionPool = require('./wallet/transaction-pool');
const Wallet = require('./wallet');
const TransactionMiner = require('./app/transaction-miner');
const isDevelopment = process.env.ENV === 'development';
const REDIS_URL = isDevelopment ?
'redis://127.0.0.1:6379' :
'rediss://:p417528cc1746793a653dccc6de7f0a0e7ed4054f0a5eb651bdcaa74625590bed@ec2-44-193-232-130.compute-1.amazonaws.com:9790';
const DEFAULT_PORT = 3000;
const ROOT_NODE_ADDRESS = `http://localhost:${DEFAULT_PORT}`;
const app = express();
const blockchain = new Blockchain();
const transactionPool = new TransactionPool();
const wallet = new Wallet({blockchain});
const pubsub = new PubSub({blockchain, transactionPool, redisUrl: REDIS_URL});
const transactionMiner = new TransactionMiner({blockchain, transactionPool, wallet, pubsub});
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, 'client/dist')));
app.get('/api/blocks', (req, res) => {
res.json(blockchain.chain);
});
app.post('/api/mine', (req, res) => {
const {data} = req.body;
blockchain.addBlock({data});
pubsub.broadcastChain();
res.redirect('/api/blocks');
});
app.post('/api/transact', (req, res) => {
const {amount, recipient} = req.body;
let transaction = transactionPool
.existingTransaction({inputAddress: wallet.publicKey});
try {
if (transaction) {
transaction.update({senderWallet: wallet, recipient, amount});
} else {
transaction = wallet.createTransaction({
recipient,
amount,
chain: blockchain.chain
});
}
} catch(error) {
return res.status(400).json({type: 'error', message: error.message});
}
transactionPool.setTransaction(transaction);
pubsub.broadcastTransaction(transaction);
res.json({type: 'success', transaction});
});
app.get('/api/transaction-pool-map', (req, res) => {
res.json(transactionPool.transactionMap);
});
app.get('/api/mine-transactions', (req, res) => {
transactionMiner.mineTransactions();
res.redirect('/api/blocks');
});
app.get('/api/wallet', (req, res) => {
const address = wallet.publicKey;
res.json({
address,
balance: Wallet.calculateBalance({chain: blockchain.chain, address, timestamp: blockchain.timestamp})});
});
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'client/dist/index.html'));
});
const syncWithRootState = () => {
request({url: `${ROOT_NODE_ADDRESS}/api/blocks`}, (error, response, body) => {
if (!error && response.statusCode === 200) {
const rootChain = JSON.parse(body);
console.log('Replacing chain on a sync with', rootChain);
blockchain.replaceChain(rootChain);
}
});
request({url: `${ROOT_NODE_ADDRESS}/api/transaction-pool-map`}, (error, response, body) => {
if (!error && response.statusCode === 200) {
const rootTransactionPoolMap = JSON.parse(body);
console.log('Replacing transaction pool map on a sync with', rootTransactionPoolMap);
transactionPool.setMap(rootTransactionPoolMap);
}
});
};
let PEER_PORT;
if (process.env.GENERATE_PEER_PORT === 'true') {
PEER_PORT = DEFAULT_PORT + Math.ceil(Math.random() * 1000);
}
const PORT = process.env.PORT || PEER_PORT || DEFAULT_PORT;
app.listen(PORT, () => {
console.log(`listening at localhost: ${PORT}`)
if (PORT !== DEFAULT_PORT) {
syncWithRootState();
}
});
//package.json
{
"name": "cryptochain",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "jest --watchAll",
"start": "npm run build-client & NODE_TLS_REJECT_UNAUTHORIZED='0' node index.js",
"dev": "npm run dev-client & npm run start-redis && cross-env ENV='development' nodemon index.js",
"dev-peer": "cross-env GENERATE_PEER_PORT='true' ENV='development' nodemon index.js",
"start-redis": "redis-server --daemonize yes",
"build-client": "npm run clean && parcel build client/src/index.html --out-dir client/dist",
"dev-client": "npm run clean && parcel client/src/index.html --out-dir client/dist",
"clean": "rm -rf .cache client/dist"
},
"jest": {
"testEnvironment": "node"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-react-constant-elements": "^7.14.5",
"@babel/plugin-transform-react-inline-elements": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-es2015": "^7.0.0-beta.53",
"@babel/preset-react": "^7.14.5",
"@babel/runtime": "^7.14.6",
"@svgr/webpack": "^3.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"cross-env": "^7.0.3",
"css-loader": "^5.2.6",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2",
"jest": "^27.0.5",
"mini-css-extract-plugin": "^1.6.1",
"nodemon": "^2.0.7",
"optimize-css-assets-webpack-plugin": "^6.0.1",
"parcel-bundler": "^1.12.3",
"style-loader": "^3.0.0",
"terser-webpack-plugin": "^5.1.4",
"url-loader": "^4.1.1",
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^1.16.5"
},
"dependencies": {
"babel-preset-es2015": "^6.24.1",
"body-parser": "^1.19.0",
"cli": "^1.0.1",
"elliptic": "^6.5.4",
"express": "^4.16.3",
"hex-to-binary": "^1.0.1",
"history": "^4.10.1",
"lodash": "^4.17.21",
"parcel": "^2.0.0-nightly.734",
"react": "^17.0.2",
"react-bootstrap": "^1.6.1",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"redis": "^3.1.2",
"request": "^2.88.2",
"uuid": "^8.3.2"
},
"description": ""
}
我浏览了其他与这个问题有关的帖子,但都有点晦涩。如果有人能帮我,那就太好了!
此错误表示应用程序希望安装redis
,但不是:
错误:找不到模块"redis">
通过安装包来修复此问题,使其成为package.json
:中的依赖项
npm install redis
我在package.json文件的依赖项中没有看到redis包,所以这可能是的问题
尝试使用npm i redis
重新安装程序包,然后重新部署。