我试图使用这里描述的平均堆栈:http://mean.io/
安装后,制作"grunt"时,出现错误:
debugger listening on port 5858 4 Jan 01:47:40 - [nodemon] reading ignore list Express app started on port 3000 events.js:72 throw er; // Unhandled 'error' event ^ Error: failed to connect to [localhost:27017] at null.(/mean/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:540:74) at EventEmitter.emit (events.js:106:17) at null. (/mean/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15) at EventEmitter.emit (events.js:98:17) at Socket. (/mean/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:478:10) at Socket.EventEmitter.emit (events.js:95:17) at net.js:441:14 at process._tickCallback (node.js:415:13) 4 Jan 01:47:40 - [nodemon] app crashed - waiting for file changes before starting...
我尝试了网站上指定的故障排除:更新Grunt,凉亭和清洁npm和凉亭缓存效果很好.但是更新npm也会出错:
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
这看起来像是自制软件和npm之间的冲突.但无论如何我安装了1.3.21版本.
我正在尝试时出现同样的错误node server
.
你有什么想法让服务器工作吗?
这可能太简单了,但看起来你的MongoDB服务器实际上并没有运行.在安装Mongo之后(在我的Mac上,我假设?),你必须打开一个终端窗口/标签,运行mongod
并使其保持运行(或使用screen
等).您可以通过键入mongo
来确保服务器正在运行来尝试访问MongoDB CLI .