目前,我正在尝试通过cli(cmd)在我的Windows 10上安装 MEAN 。
我想我已经完成了MEAN的所有安装部分,并使用 npm 来安装教程中提到的所有软件包,当我输入 gulp(运行)它给了我这个错误: -
C:\...\nishant>gulp
Invoking gulp - development
[15:46:19] Using gulpfile ~\node\nishant\gulpfile.js
[15:46:19] Starting 'clean'...
[15:46:19] Finished 'clean' after 8.28 ms
[15:46:19] Starting 'default'...
[15:46:19] Starting 'webpack:build-dev'...
[15:46:19] Starting 'clean'...
[15:46:19] Starting 'less'...
[15:46:19] Starting 'sass'...
[15:46:19] Starting 'csslint'...
[15:46:19] Starting 'env:development'...
[15:46:19] Finished 'env:development' after 43 μs
[15:46:19] Starting 'devServe'...
[15:46:19] Finished 'devServe' after 96 ms
[15:46:19] Starting 'watch'...
[15:46:20] Finished 'watch' after 171 ms
[15:46:20] Finished 'clean' after 687 ms
[15:46:20] Finished 'less' after 692 ms
[15:46:20] Finished 'sass' after 418 ms
[15:46:20] csslint: 0 files lint free
[15:46:20] Finished 'csslint' after 399 ms
[15:46:20] [nodemon] 1.9.2
[15:46:20] [nodemon] to restart at any time, enter `rs`
[15:46:20] [nodemon] watching: *.*
[15:46:20] [nodemon] starting `node --debug server.js`
Debugger listening on port 5858
Error: connect ECONNREFUSED 127.0.0.1:27017
**Could not connect to MongoDB. Please ensure mongod is running and restart MEAN app.**
[15:46:27] [nodemon] clean exit - waiting for changes before restart
我试图搜索答案,但它们可用于Linux或Mac,但不适用于Windows。
答案 0 :(得分:1)
看起来MongoDb没有作为服务运行。如果内存服务,您可能必须手动安装该服务。首先检查它是否已安装:开始 - >运行 - >输入services.msc
并在服务列表中查找。如果它在那里,请确保它正在运行。如果没有,请查看https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/以了解有关服务安装的步骤。