-3
私は以下のエラーを与える単純なフォームを持っています。 例外TypeError:未定義には20 pleseは私は私のノードのjsプロジェクト上のデータベースconncectionでシンプルなページに取り組んでいてくれタイプエラー未定義はノードjsの関数ではありません
var path = require('path')
var funcs = require('./funcs')
var encodeName = funcs.encodName
var session = {
username: process.argv[2],
lastMessageHash: process.argv[3]
}
if (!session.username || !session.lastMessageHash) {
console.log('Usage: node index.js <username> <hash>')
process.exit(0)
}
// 1. load the database
var dbFile = path.join(__dirname, 'db', 'index.json')
funcs.loadDb(dbFile, function (err, db) {
// 2. encode the name
var encoded = encodeName(session.usrename) // error line no 20
// 3. find the user's inbox
var inbox = funcs.findInbox(db, encoded)
// 4. find the next message
var nextMessage = funcs.findNextMessage(inbox, session.lastMessageHash)
// 5. print out the message.
// Paste the console output into the "Solution" field and you're done!
console.log(nextMessage)
})
を助けないライン上の関数ではありません。私はnodejsでnewbeです。
funcs.encodNameをfuncファイルからエクスポートする方法はありますか?問題はそこにあるはずです。あるいは、func.jsファイル全体を表示することもできます。ありがとう。 –
@patel投稿した質問は削除しないでください。それはあなたを助けようとしている人に欲求不満を引き起こす可能性があります。あなたがそれを解決したら、答えを出してください。 – kojow7