Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

npm start fails #30

Closed
akrigline opened this issue Sep 19, 2015 · 5 comments
Closed

npm start fails #30

akrigline opened this issue Sep 19, 2015 · 5 comments

Comments

@akrigline
Copy link

Installed MongoDB and Node.js 0.12

Here's what happens when I try npm start:

Andrews-iMac:sws_gathers andrewkrigline$ npm start

> sws_gathers@1.0.0 start /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers
> npm run compile && node --harmony index.js


> sws_gathers@1.0.0 compile /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers
> node_modules/gulp/bin/gulp.js

[10:57:06] Using gulpfile ~/Projects/02.Self/11.NS2/sws_gathers/gulpfile.js
[10:57:06] Starting 'compile'...
[10:57:07] Finished 'compile' after 724 ms
[10:57:07] Starting 'default'...
[10:57:07] Finished 'default' after 13 μs
Listening on port 8000

/Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers/node_modules/mongoose/node_modules/mongodb/lib/server.js:228
        process.nextTick(function() { throw err; })
                                            ^
Error: connect ECONNREFUSED
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/andrewkrigline/.nvm/versions/node/v0.12.7/bin/node" "/Users/andrewkrigline/.nvm/versions/node/v0.12.7/bin/npm" "start"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! sws_gathers@1.0.0 start: `npm run compile && node --harmony index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sws_gathers@1.0.0 start script 'npm run compile && node --harmony index.js'.
npm ERR! This is most likely a problem with the sws_gathers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run compile && node --harmony index.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls sws_gathers
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers/npm-debug.log

Here's DebugLog:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/andrewkrigline/.nvm/versions/node/v0.12.7/bin/node',
1 verbose cli   '/Users/andrewkrigline/.nvm/versions/node/v0.12.7/bin/npm',
1 verbose cli   'start' ]
2 info using npm@2.11.3
3 info using node@v0.12.7
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart sws_gathers@1.0.0
6 info start sws_gathers@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info sws_gathers@1.0.0 Failed to exec start script
9 verbose stack Error: sws_gathers@1.0.0 start: `npm run compile && node --harmony index.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/Users/andrewkrigline/.nvm/versions/node/v0.12.7/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/Users/andrewkrigline/.nvm/versions/node/v0.12.7/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid sws_gathers@1.0.0
11 verbose cwd /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers
12 error Darwin 14.5.0
13 error argv "/Users/andrewkrigline/.nvm/versions/node/v0.12.7/bin/node" "/Users/andrewkrigline/.nvm/versions/node/v0.12.7/bin/npm" "start"
14 error node v0.12.7
15 error npm  v2.11.3
16 error code ELIFECYCLE
17 error sws_gathers@1.0.0 start: `npm run compile && node --harmony index.js`
17 error Exit status 1
18 error Failed at the sws_gathers@1.0.0 start script 'npm run compile && node --harmony index.js'.
18 error This is most likely a problem with the sws_gathers package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     npm run compile && node --harmony index.js
18 error You can get their info via:
18 error     npm owner ls sws_gathers
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
@cblanc
Copy link
Owner

cblanc commented Sep 19, 2015

Sounds like the app can't connect to mongodb. In the development env, the app will attempt to connect to mongodb on localhost:27015 with default settings - you can check it's available by connecting to it yourself with mongo in your terminal

If it's not running, you can start the db with mongod

@cblanc
Copy link
Owner

cblanc commented Sep 19, 2015

Forgot to mention, if you intend on running this locally for dev I suggest running the following commands in parallel

npm run watch - watches frontend js and recompiles if any changes have been made
npm run dev - runs the app and watches for changes

@akrigline
Copy link
Author

Ah. Gotchya. Always the databases with me.

Started mongo with mongod --dbpath db. Idk if it's happy or not though.

Andrews-iMac:sws_gathers andrewkrigline$ mongod --dbpath db
2015-09-20T00:16:26.098-0400 I JOURNAL  [initandlisten] journal dir=db/journal
2015-09-20T00:16:26.098-0400 I JOURNAL  [initandlisten] recover : no journal files present, no recovery needed
2015-09-20T00:16:26.121-0400 I JOURNAL  [durability] Durability thread started
2015-09-20T00:16:26.121-0400 I JOURNAL  [journal writer] Journal writer thread started
2015-09-20T00:16:26.121-0400 I CONTROL  [initandlisten] MongoDB starting : pid=9222 port=27017 dbpath=db 64-bit host=Andrews-iMac.local
2015-09-20T00:16:26.121-0400 I CONTROL  [initandlisten] 
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] db version v3.0.6
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] git version: nogitversion
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] build info: Darwin yosemitevm.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] allocator: system
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] options: { storage: { dbPath: "db" } }
2015-09-20T00:16:26.122-0400 I INDEX    [initandlisten] allocating new ns file db/local.ns, filling with zeroes...
2015-09-20T00:16:26.301-0400 I STORAGE  [FileAllocator] allocating new datafile db/local.0, filling with zeroes...
2015-09-20T00:16:26.302-0400 I STORAGE  [FileAllocator] creating directory db/_tmp
2015-09-20T00:16:26.917-0400 I STORAGE  [FileAllocator] done allocating datafile db/local.0, size: 64MB,  took 0.615 secs
2015-09-20T00:16:27.156-0400 I NETWORK  [initandlisten] waiting for connections on port 27017
2015-09-20T00:16:51.584-0400 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:60005 #1 (1 connection now open)
2015-09-20T00:17:11.903-0400 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:60006 #2 (2 connections now open)

Tried to run npm start again and new Errors:

Andrews-iMac:sws_gathers andrewkrigline$ npm start

> sws_gathers@1.0.0 start /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers
> npm run compile && node --harmony index.js


> sws_gathers@1.0.0 compile /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers
> node_modules/gulp/bin/gulp.js

[00:17:27] Using gulpfile ~/Projects/02.Self/11.NS2/sws_gathers/gulpfile.js
[00:17:27] Starting 'compile'...
[00:17:28] Finished 'compile' after 742 ms
[00:17:28] Starting 'default'...
[00:17:28] Finished 'default' after 6.07 μs

/Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers/db/models/message.js:21
messageSchema.methods.toJson = () => {
                                ^
SyntaxError: Unexpected token )
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers/db/index.js:10:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers/index.js:13:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

npm ERR! sws_gathers@1.0.0 start: `npm run compile && node --harmony index.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the sws_gathers@1.0.0 start script.
npm ERR! This is most likely a problem with the sws_gathers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run compile && node --harmony index.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls sws_gathers
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 14.5.0
npm ERR! command "node" "/usr/local/bin/npm" "start"
npm ERR! cwd /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers
npm ERR! node -v v0.10.29
npm ERR! npm -v 2.0.0-alpha-5
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/andrewkrigline/Projects/02.Self/11.NS2/sws_gathers/npm-debug.log
npm ERR! not ok code 0

Running mongo shows this:

Andrews-iMac:sws_gathers andrewkrigline$ mongo
MongoDB shell version: 3.0.6
connecting to: test
Server has startup warnings: 
2015-09-20T00:16:26.121-0400 I CONTROL  [initandlisten] 
2015-09-20T00:16:26.122-0400 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

I'm guessing I need to do some config work for Mongo?

@akrigline
Copy link
Author

Also, after this does start, where is it? localhost:27015?

@cblanc
Copy link
Owner

cblanc commented Sep 20, 2015

Yes localhost:27015, MongoDB is working fine.

Issue here is you're running Node 0.12 npm ERR! node -v v0.10.29

If you have 0.12, you may have to update the symlink to your system node

Otherwise you can use nvm to manage node versions. Once it's installed it's a matter of nvm install 0.12 and nvm use 0.12 when you want to switch into 0.12

@cblanc cblanc closed this as completed Sep 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants