mongod --dbpath /usr/local/var/mongodb
2018-07-03T10:50:12.444+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] MongoDB starting : pid=44555 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=huhaifengdeMacBook-Pro.local
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] db version v4.0.0
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
2018-07-03T10:50:12.457+0800 I CONTROL [initandlisten] allocator: system
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] modules: none
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] build environment:
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] distarch: x86_64
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] target_arch: x86_64
2018-07-03T10:50:12.458+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "/usr/local/var/mongodb" } }
2018-07-03T10:50:12.458+0800 I STORAGE [initandlisten] Detected data files in /usr/local/var/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-07-03T10:50:12.458+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7680M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-07-03T10:50:13.065+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:65896][44555:0x7fffa9ffe380], txn-recover: Main recovery loop: starting at 10/5888
2018-07-03T10:50:13.160+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:160125][44555:0x7fffa9ffe380], txn-recover: Recovering log 10 through 11
2018-07-03T10:50:13.224+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:224134][44555:0x7fffa9ffe380], txn-recover: Recovering log 11 through 11
2018-07-03T10:50:13.273+0800 I STORAGE [initandlisten] WiredTiger message [1530586213:273601][44555:0x7fffa9ffe380], txn-recover: Set global recovery timestamp: 0
2018-07-03T10:50:13.347+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten]
2018-07-03T10:50:13.386+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2018-07-03T10:50:13.427+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/usr/local/var/mongodb/diagnostic.data'
2018-07-03T10:50:13.431+0800 I NETWORK [initandlisten] waiting for connections on port 27017
const express = require('express')
const mongoose = require('mongoose')
//鏈接mongo
const DB_URL = 'mongodb://localhost:27017/'
mongoose.connect(DB_URL)
mongoose.connection.on('connected', function(){
console.log('mongo connect success!')
})
// 新建app
const app = express()
app.get('/', function (req, res) {
res.send('<h1>Hello World1e23</h1>')
})
app.get('/data', function(req, res) {
res.json({name: 'hhf12ees3', type: 'IT'})
})
app.listen(9093, function(){
console.log('Node app start at port 9093')
})
報問題 [nodemon] app crashed - waiting for file changes before starting...
怎么解決
關于MongoDB
首先是警告不是錯誤,并不會造成你不能運行;
其次警告的內容是不是自己先理解一下,看看有什么不懂的地方?
關于NodeJS
可能要說英文不好,那我們來一個詞一個詞讀讀
app crashed - waiting for file changes before starting...
應用崩潰了 - 等待文件變更 在重啟之前...
意思是不是很明白?由于某種錯誤應用不能成功啟動,那么現在能重試嗎?不管怎么重試還是會失敗對不對?所以nodemon要等待文件有變更后再重試是不是更有道理一些呢?
那到底是什么問題?看日志啊,沒有日志鬼知道什么問題。
無關的話:建議樓主看到一大堆英文就算很崩潰還是讀一下,并沒有你想象的那么難。永遠不讀就永遠不會懂,讀一讀,慢慢就越來越容易。
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數據專業(yè)的國家
北大青鳥中博軟件學院創(chuàng)立于2003年,作為華東區(qū)著名互聯網學院和江蘇省首批服務外包人才培訓基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團創(chuàng)建于1999年,經過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術與教育服務機構,發(fā)展為教育服務業(yè)的綜合性企業(yè)集團,成為集合面授教學培訓、網
達內教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構,是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經理從事移動互聯網管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經理職務負責iOS教學及管理工作。
浪潮集團項目經理。精通Java與.NET 技術, 熟練的跨平臺面向對象開發(fā)經驗,技術功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網頁制作和網頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經驗。曾經歷任德國Software AG 技術顧問,美國Dachieve 系統(tǒng)架構師,美國AngelEngineers Inc. 系統(tǒng)架構師。