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

JavaScript Building a MEAN Application Setting Up MongoDB Debugging Express Application Refresher

16,963 Points

"Error: EACCES: permission denied" when running iron-node

After successfully installing iron-node and when running 'iron-node src/app.js', the console returns:

  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/iron-node/bin/iron-node.env.json'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.writeFileSync (fs.js:1224:33)
    at /usr/local/lib/node_modules/iron-node/bin/run.js:41:5
    at onStdIn (/usr/local/lib/node_modules/iron-node/bin/run.js:17:3)
    at Object.<anonymous> (/usr/local/lib/node_modules/iron-node/bin/run.js:33:1)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
  • I'm running Ubuntu 16.04
  • I have tried this with all combinations of nodemon running/not running with mondodb running/not running
  • Tried re-installing
  • Even tried with sudo because it says permission denied...

How do I get this to work like it does in the video?

EDIT: When I run sudo iron-node src/app.js. A pop up box occurs and says:

Uncaught Exception:
TypeError: app.getPath is not a function
    at Config (/usr/local/lib/node_modules/iron-node/app/config.js:56:35)
    at initializeApplication (/usr/local/lib/node_modules/iron-node/app/index.js:35:41)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/iron-node/app/index.js:48:15)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)

2 Answers

Christopher Burgdorff
Christopher Burgdorff
9,695 Points

I meant that as a comment, not an answer.