Tôi đang xây dựng một cơ sở MEAN webapp và tôi mới vào stack. Tôi có mặt trước cuối chạy, nhưng ngay sau khi tôi thêm các dòng sau vào app.js:Mongoose: Lỗi không thể tìm thấy mô-đun debug
var mongoose = require('mongoose');
require('./models/test');
mongoose.connect('mongodb://localhost:3000/design-data-test');
tôi nhận được lỗi sau trong terminal:
Error: Cannot find module 'debug'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/username/node_modules/mongoose/node_modules/mquery/lib/mquery.js:11:13)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
Và tất cả các mã cuối phía trước của tôi ngừng chạy. Mongodb đang chạy trên cổng mặc định.
Làm thế nào tôi sẽ đi về việc giải quyết lỗi này?
Cố gắng cài đặt 'NPM cài đặt debug --save-dev' mô-đun –
Nhưng module 'debug' đã tồn tại trong mô-đun 'mquery' https://github.com/aheckmann/mquery/blob/master/package.json#L15 Cố gắng cài đặt lại mô-đun 'mongoose' và đảm bảo rằng đây không phải là lỗi. –
@ArtemBaranovskii, đó sẽ là một sửa chữa tốt đẹp, nhưng tôi vẫn nhận được lỗi tương tự. Bất cứ một đề nghị nào khác? – Carriemf