jussikinnula / angular-socket-io-chat

An example Angular chat app, made on top of ExpressJS & Socket.io.
GNU General Public License v3.0
130 stars 40 forks source link

ENOENT: no such file or directory, open '...\angular2-socketio-chat-example\.env' #4

Closed andrejb-dev closed 8 years ago

andrejb-dev commented 8 years ago

after cloning repo, running npm install and running npm start I got this error:


{ Error: ENOENT: no such file or directory, open 'C:\Development\projects\js\temp\angular2-socketio-chat-example\.env'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Object.config (C:\Development\projects\js\temp\angular2-socketio-chat-example\node_modules\dotenv\lib\main.js:30:37)
    at Server.config (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:77:17)
    at new Server (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:66:15)
    at Function.Server.bootstrap (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:74:17)
    at Object.<anonymous> (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:111:22)
    at Object.<anonymous> (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:114:31)
    at __webpack_require__ (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:20:30)
    at Object.<anonymous> (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:47:12)
    at __webpack_require__ (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:20:30)
    at C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:40:18
    at Object.<anonymous> (C:\Development\projects\js\temp\angular2-socketio-chat-example\target\assets\js\server.js:43:10)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Development\\projects\\js\\temp\\angular2-socketio-chat-example\\.env' }
==> Listening on port 5000. Open up http://localhost:5000/ in your browser.

C:\Development\projects\js\temp\angular2-socketio-chat-example\node_modules\mongodb\lib\server.js:242
        process.nextTick(function() { throw err; })
                                      ^
Error: connect ECONNREFUSED 127.0.0.1:27017
    at Object.exports._errnoException (util.js:1036:11)
    at exports._exceptionWithHostPort (util.js:1059:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! angular2-socketio-chat-example@0.0.5 start: `node target/assets/js/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-socketio-chat-example@0.0.5 start script 'node target/assets/js/server.js'.
jussikinnula commented 8 years ago

You need to have MongoDB running, before launching the application. You can put the MongoDB URL to .env -file if the configuration differs from the default one (default is mongodb://localhost:27017/chat).

To install and start dependencies in Windows, I did already write a guide on my other boilerplate: https://github.com/jussikinnula/angular2-mean-starter

andrejb-dev commented 8 years ago

thanks i will try it.

jussikinnula commented 8 years ago

I just released a "1.0.0" version of this example app, with Angular 2.0.0 final support - and also hotfixes for the dependencies currently not working properly with Webpack 2 & NodeJS 6. Please check the latest version, it also has Windows instructions (same as mentioned earlier).