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, 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.