Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Killeon Patterson
Killeon Patterson
18,528 Points

Difficulty starting npm

I'm having trouble starting npm in my project folder. I had the project open in its file with everything running fine, and then my computer had to restart. Now when I attempt to run npm start I receive error messages. I ran npm trace in the console and it told me to "specify configs in the ini-formatted file: C:\ Users/Leimamo/npmrc." I'm unsure of what configurations that the system is requesting.

Here is a link to my gist. https://gist.github.com/Satellite9/5e4ce3de5c19cee2f355d872b6d7d3c8

Thank you for your time.

Killeon

1 Answer

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

I'm unsure what the problem is. npmrc is something related to npm. Maybe uninstall and reinstall node.js and npm.

Killeon Patterson
Killeon Patterson
18,528 Points

Hello Andrew,

I was tinkering with solving the issue I was experiencing last night. I ran npm in the project folder, where it was reinstalled, and received these errors. One of them suggested that I did not have the correct versions of node and npm. Although, I didn't manual update either and they are not set for automatic updating. Do you recognize any of these errors as possible indicators to my issue? Thank you for your time.

C:\Users\Leimamo\PhpstormProjects\untitled2\bin
< untitled2@0.0.0 start C:\Users\Leimamo\PhpstormProjects\untitled2
<node ./bin/www

Events.js:160
    Throw er; // Unhandled β€˜error’ event

MongoError:  failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]

at Pool.<anonymous> (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\mongodb-core\lib\topologies\server.js:328:35)

    at emitOne (events.js:96:13)

    at Pool.emit (events.js:188:7)

    at Connection.<anonymous> (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\mongodb-core\lib\connection\pool.js:274:12)

at Connection.g (events.js:292:16)

at emitTwo (events.js:106:13)

at Connection.emit (events.js:191:7)

at Socket.<anonymous> (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\mongodb-core\lib\connection\connection.js:177:49)

at Socket.g (events.js:292:16)

at emitOne (events.js:96:13)

at Socket.emit (events.js:188:7)

at emitErrornt (net.js:1277:8)

at _combinedTickCallback (internal/process/next_tick.js:80:11)

at process._ticketCallback (internal/process/next_tick.js.:104:9)

npm ERR! Windows_NT 10.0.14393

npm ERR! Argv β€œC:\\Program Files\\nodejs\\node.exe” β€œC:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js” β€œstart” β€œ--trace”

npm ERR! node v6.10.3

npm ERR! npm v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! untitled2@0.0.0 start: β€˜node ./bin/www’

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the untitled2@0.0.0 start script β€˜node ./bin/www’.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the untitled2 package,

npm ERR! not the npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!    node ./bin/www

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!    npm bugs untitled2

npm ERR! Or if that isn’t available, you can get their info via:

npm ERR!    npm owner ls untitled2

npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR!    C:\Users\Leimamo\PhpstormProjects\untitled2\bin\npm-debug.log
Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

It looks like you haven't implemented an error handler for the mongo connection. It says the connection was refused...this could mean mongo isn't running, or the permissions aren't set up correctly.