Using PM2 with highcharts-export-server does not work - node.js

In the documentation for highcharts-export-server : it says that you should use PM2 to run it as a server but I just can't get this to work on my Windows machine.
I have no problem to run it from the command line :
highcharts-export-server --enableServer 1
However when I run :
pm2 start highcharts-export-server -- --enableServer 1
I get :
[PM2] Applying action restartProcessId on app [highcharts-export-server](ids: [ 0 ])
[PM2] [highcharts-export-server](0) ✓
[PM2] Process successfully started
┌─────┬─────────────────────────────┬─────────────┬─────────┬─────────┬──────────┬─────── ─┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼─────────────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ highcharts-export-server │ default │ N/A │ fork │ 13916 │ 0 │ 50 │ stopped │ 0% │ 0b │ <ME> │ disabled │
└─────┴─────────────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
It doesn't work and I get this error multiple times in highcharts-export-server-error.log :
C:\USERS\<ME>\APPDATA\ROAMING\NPM\HIGHCHARTS-EXPORT-SERVER.CMD:1
#ECHO off
^
SyntaxError: Invalid or unexpected token
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Object.<anonymous> (C:\Users\lars\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:33:23)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
I don't undertand what I'm doing wrong here because this works flawlessly on my Mac machine

Related

Cannot run node js app on nginx server because address is already in use

I am running a node js app on nginx/digital ocean .
When i try to run pm2 start app.js i get this
┌─────┬────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ app │ default │ 1.2.0 │ fork │ 0 │ 0 │ 30 │ errored │ 0% │ 0b │ root │ disabled │
│ 1 │ app │ default │ 1.2.0 │ fork │ 49014 │ 0s │ 0 │ online │ 0% │ 15.1mb │ root │ disabled │
└─────┴────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
**
when i try "node app.js" looks like this**
node:events:491
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::4000
at Server.setupListenHandle [as _listen2] (node:net:1733:16)
at listenInCluster (node:net:1781:12)
at Server.listen (node:net:1869:7)
at Function.listen (/var/www/delivery.emms.io/html/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/var/www/delivery.emms.io/html/app.js:114:5)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1760:8)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'EADDRINUSE',
errno: -98,
syscall: 'listen',
address: '::',
port: 4000
}
i tried getting the PID and using kill -9 but no success
any ideas?

I am getting error EACCES: permission denied, open '/root/.pm2/module_conf.json' error after npm start command

When trying to run npm start, I get the error:
Error: EACCES: permission denied, open '/root/.pm2/module_conf.json'
at Object.openSync (node:fs:582:3)
at Object.readFileSync (node:fs:450:35)
at Object.Configuration.getAllSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:299:26)
at Object.Configuration.getSync (/usr/local/lib/node_modules/pm2/lib/Configuration.js:270:30)
at new API (/usr/local/lib/node_modules/pm2/lib/API.js:117:44)
at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/CLI.js:22:11)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
/usr/local/lib/node_modules/pm2/node_modules/#pm2/agent/src/InteractorClient.js:58
if (stats.uid === 0) {
^
TypeError: Cannot read property 'uid' of undefined
at /usr/local/lib/node_modules/pm2/node_modules/#pm2/agent/src/InteractorClient.js:58:21
at FSReqCallback.oncomplete (node:fs:195:21)
the command in package.json looks like this
{
"scripts": {
"start": "pm2 start ./node_modules/laravel-echo-server/dist/index.js"
},
"dependencies": {
"laravel-echo-server": "^1.6.2",
"save": "^2.4.0"
}
}
But if I run the command in the terminal
pm2 start ./node_modules/laravel-echo-server/dist/index.js
it works fine
/app # pm2 start ./node_modules/laravel-echo-server/dist/index.js
[PM2] Starting /app/node_modules/laravel-echo-server/dist/index.js in fork_mode (1 instance)
[PM2] Done.
┌─────┬────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 1 │ index │ default │ 1.6.2 │ fork │ 13626 │ 0s │ 0 │ online │ 0% │ 7.6mb │ root │ disabled │
│ 0 │ laravelEcho │ default │ 1.6.2 │ fork │ 13608 │ 1s │ 1207 │ online │ 0% │ 69.6mb │ root │ disabled │
└─────┴────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2][WARN] Current process list is not synchronized with saved list. Type 'pm2 save' to synchronize.
After searching the internet for a solution to the problem, I saw a possible solution, but it didn't work for me either.
This solution was to create an ecosystem.config.js file
here is an example with this solution but it doesn't work either
package.json
{
"scripts": {
"start": "pm2 start ecosystem.config.js"
},
"dependencies": {
"laravel-echo-server": "^1.6.2",
"save": "^2.4.0"
}
}
ecosystem.config.js
module.exports = {
apps : [
{
name: "laravelEcho",
script: "./node_modules/laravel-echo-server/dist/index.js",
args : "start"
}
]
}
Perhaps this will help when looking for the problem, I am using Docker
Dockerfile
FROM node:alpine
WORKDIR /app
RUN npm install pm2:2.9.2 -g && pm2 update
EXPOSE 8888
What could be the problem?
not sure it's great to run it as root, have a look here on pm2s git repo on user access: Starting PM2 as a non-root user is broken
i think you can fix the "permission denied" with running this as su so just run sudo npm start but because i can't code in js i can't help you with the errors i'm sorry!:/
I hope i could help you anyways a little bit!!

Unable to restart Node.js app after PM2 delete

I usually do pm2 stop to stop my application and it works fine.
However, when I just tried the pm2 delete on my app and starting it again, it doesn't seem to work anymore.
This is the pm2 error log I retrieved. No code was changed so I think it might be some ECONNRESET error from abrupt shutdown? (there wasn't any cleanup code)
Also tried killing the pid of pm2 and mongod when I find it using ps -ef and also pm2 kill and restarting of mongod to no avail.
Error: Invalid mongodb uri. Must begin with "mongodb://"
Received: NaN
at muri (/home/ubuntu/portal/node_modules/muri/lib/index.js:28:11)
at NativeConnection.Connection.openUri (/home/ubuntu/portal/node_modules/mongoose/lib/connection.js:713:18)
at Mongoose.createConnection (/home/ubuntu/portal/node_modules/mongoose/lib/index.js:198:17)
at Object.<anonymous> (/home/ubuntu/portal/models/stopwords.js:11:19)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/ubuntu/portal/helpers/database/helper_mongodb.js:2:19)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/ubuntu/portal/controllers/inf_controller.js:2:19)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
Code for stopwords.js:11:19 is
let db = mongoose.createConnection(process.env.MONGODB_URI + process.env.MONGODB_HELPER_DB, { useMongoClient: true })
As we commented, and as you did, I also solved my problems using pm2
+ grunt to run my express.js app. Will try to explain here the solution to close the question.
The way to start and stop pm2 with different apps and without trouble
was with an ecosystem file where I configured my node apps.(centOS apache)
my ecosystem file
-bash-4.2$ pm2 ecosystem
File /var/www/vhosts/domain.com/ecosystem.config.js
[...]
-bash-4.2$ cat ecosystem.config.js
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps : [
// First application
{
name : 'DomainProd',
cwd : '/var/www/vhosts/domain.com/httpdocs/App',
script : 'start.sh'
},
{
name : 'DomainTest',
cwd : '/var/www/vhosts/domain.com/testing.domain.com/httpdocs/App',
script : 'start-test.sh'
}
]
};
the start.sh script
-bash-4.2$ cat /var/www/vhosts/domain.com/httpdocs/App/start.sh
/usr/bin/grunt serve:prod
-bash-4.2$
The serve task on my Gruntfile
return grunt.task.run(['concurrent:cleanandbuild', 'build', 'env:all', 'env:prod', 'express:prod', 'wait', 'express-keepalive']);
The run example:
-bash-4.2$ pm2 status
┌────────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬────────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
├────────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼────────────┼──────────┤
│ DomainProd │ 0 │ fork │ 17992 │ online │ 63 │ 20D │ 0% │ 264.1 MB │ disabled │
│ DomainTest │ 1 │ fork │ 25526 │ online │ 295 │ 113m │ 0% │ 1.2 MB │ disabled │
└────────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴────────────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
-bash-4.2$ pm2 stop 1
[PM2] Applying action stopProcessId on app [1](ids: 1)
[PM2] [Domainest](1) ✓
┌────────────┬────┬──────┬───────┬─────────┬─────────┬────────┬─────┬────────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
├────────────┼────┼──────┼───────┼─────────┼─────────┼────────┼─────┼────────────┼──────────┤
│ DomainProd │ 0 │ fork │ 17992 │ online │ 63 │ 20D │ 0% │ 264.1 MB │ disabled │
│ DomainTest │ 1 │ fork │ 0 │ stopped │ 295 │ 0 │ 0% │ 0 B │ disabled │
└────────────┴────┴──────┴───────┴─────────┴─────────┴────────┴─────┴────────────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
-bash-4.2$ pm2 start 1
[PM2] Applying action restartProcessId on app [1](ids: 1)
[PM2] [DomainTest](1) ✓
[PM2] Process successfully started
┌────────────┬────┬──────┬───────┬────────┬─────────┬────────┬─────┬────────────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
├────────────┼────┼──────┼───────┼────────┼─────────┼────────┼─────┼────────────┼──────────┤
│ DomainProd │ 0 │ fork │ 17992 │ online │ 63 │ 20D │ 0% │ 264.1 MB │ disabled │
│ DomainTest │ 1 │ fork │ 29816 │ online │ 295 │ 0s │ 0% │ 1.2 MB │ disabled │
└────────────┴────┴──────┴───────┴────────┴─────────┴────────┴─────┴────────────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
-bash-4.2$ pm2 logs 1
[TAILING] Tailing last 15 lines for [1] process (change the value with --lines option)
/var/www/vhosts/domain.com/.pm2/logs/DomainTest-out-1.log last 15 lines:
1|DomainTe | Execution Time (2017-10-02 19:33:24 UTC+2)
1|DomainTe | loading tasks 579ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 92%
1|DomainTe | clean:server 47ms ▇▇▇▇ 7%
1|DomainTe | Total 632ms
1|DomainTe |
1|DomainTe | Running "clean:dist" (clean) task
1|DomainTe | >> 5 paths cleaned.
1|DomainTe |
1|DomainTe | Done, without errors.
1|DomainTe |
1|DomainTe |
1|DomainTe | Execution Time (2017-10-02 19:33:24 UTC+2)
1|DomainTe | loading tasks 570ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 55%
1|DomainTe | clean:dist 456ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 44%
1|DomainTe | Total 1s
[STREAMING] Now streaming realtime logs for [1] process
Hope it helps anyone arriving here.

verdaccio fail to start having an error "Cannot find module"

I am getting this error, verdaccio just crashed and no longer working after a server restart. When I try to pm2 start verdaccio , I get the following error
Error: Cannot find module '/home/ec2-user/verdaccio'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:53:21)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
npm config ls
; cli configs
scope = ""
user-agent = "npm/4.2.0 node/v7.10.0 linux x64"
; userconfig /home/ec2-user/.npmrc
http-proxy = null
https-proxy = null
registry = "https://registry.npmjs.org/"
strict-ssl = false
; globalconfig /usr/etc/npmrc
registry = "https://registry.npmjs.org/"
; node bin location = /usr/bin/node
; cwd = /home/ec2-user/verdaccio
; HOME = /home/ec2-user
; "npm config ls -l" to show all defaults.
pm2 show verdaccio
│ name │ verdaccio │
│ restarts │ 255 │
│ uptime │ 0 │
│ script path │ /home/ec2-user/verdaccio │
│ script args │ N/A │
│ error log path │ /home/ec2-user/.pm2/logs/verdaccio-error-0.log │
│ out log path │ /home/ec2-user/.pm2/logs/verdaccio-out-0.log │
│ pid path │ /home/ec2-user/.pm2/pids/verdaccio-0.pid │
│ interpreter │ node │
│ interpreter args │ N/A │
│ script id │ 0 │
│ exec cwd │ /home/ec2-user │
│ exec mode │ fork_mode │
│ node.js version │ 7.10.0 │
│ watch & reload │ ✘ │
│ unstable restarts │ 0 │
│ created at │ N/A
`
My config file is as follows:
storage: ./storage
auth:
htpasswd:
file: ./htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'av-*':
allow_access: $all
allow_publish: $all
'*':
allow_access: $all
allow_publish: $all
proxy: npmjs
'#*/*':
allow_access: $all
allow_publish: $authenticated
proxy: npmjs
https:
key: /home/ec2-user/verdaccio/verdaccio-keynew.pem
cert: /home/ec2-user/verdaccio/verdaccio-certnew.pem
ca: /home/ec2-user/verdaccio/server.ca
logs:
- {type: stdout, format: pretty, level: http}
#- {type: file, path: verdaccio.log, level: info}
listen:
- https://devnpm2:4873
max_body_size: 300mb
It can't find the verdaccio executable, to locate it you can use the which command.
To do this you should try:
pm2 start `which verdaccio`

Cannot find module 'ejs' - Node.js app on Heroku

My app was working locally but when I deployed to Heroku, there was an issue. This was my error, It seems that the error was caused by something that I failed to do after I added EJS.
2014-01-06T16:53:39.285571+00:00 app[web.1]: module.js:340
2014-01-06T16:53:39.285956+00:00 app[web.1]: throw err;
2014-01-06T16:53:39.286233+00:00 app[web.1]: ^
2014-01-06T16:53:39.288439+00:00 app[web.1]: Error: Cannot find module 'ejs'
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at require (module.js:380:17)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:28:20)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-01-06T16:53:39.288439+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-01-06T16:53:39.288617+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2014-01-06T16:53:40.650512+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-06T16:53:40.637888+00:00 heroku[web.1]: Process exited with status 8
2014-01-06T16:53:40.651134+00:00 heroku[web.1]: State changed from crashed to starting
2014-01-06T16:53:42.536106+00:00 heroku[web.1]: Starting process with command `node app.js`
2014-01-06T16:53:43.447621+00:00 app[web.1]:
2014-01-06T16:53:43.449816+00:00 app[web.1]: Error: Cannot find module 'ejs'
2014-01-06T16:53:43.447621+00:00 app[web.1]: module.js:340
2014-01-06T16:53:43.447926+00:00 app[web.1]: throw err;
2014-01-06T16:53:43.447926+00:00 app[web.1]: ^
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Module.require (module.js:364:17)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Module._compile (module.js:456:26)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Module.load (module.js:356:32)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2014-01-06T16:53:43.449990+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at require (module.js:380:17)
2014-01-06T16:53:43.449816+00:00 app[web.1]: at Object.<anonymous> (/app/app.js:28:20)
2014-01-06T16:53:44.712427+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-06T16:53:44.700963+00:00 heroku[web.1]: Process exited with status 8
2014-01-06T16:54:13.976150+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=bruxzir-express.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
2014-01-06T16:54:29.109297+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=bruxzir-express.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
2014-01-06T16:54:29.243506+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=bruxzir-express.herokuapp.com fwd="98.173.1.66" dyno= connect= service= status=503 bytes=
After reading this question on SO I needed to add that dependency in the package.json . And to the version of ejs I ran npm list and got this, which looks like there might be more errors to address.
application-name#0.0.1 /Users/juan.gallardo/Desktop/myfiles/test-projects/bruxzir-express-test
├── ejs#0.8.5 extraneous
├─┬ express#3.4.4
│ ├── buffer-crc32#0.2.1
│ ├─┬ commander#1.3.2
│ │ └── keypress#0.1.0
│ ├─┬ connect#2.11.0
│ │ ├── bytes#0.2.1
│ │ ├── methods#0.0.1
│ │ ├─┬ multiparty#2.2.0
│ │ │ ├─┬ readable-stream#1.1.9
│ │ │ │ ├── core-util-is#1.0.0
│ │ │ │ └── debuglog#0.0.2
│ │ │ └── stream-counter#0.2.0
│ │ ├── negotiator#0.3.0
│ │ ├── pause#0.0.1
│ │ ├── qs#0.6.5
│ │ ├── raw-body#0.0.3
│ │ └── uid2#0.0.3
│ ├── cookie#0.1.0
│ ├── cookie-signature#1.0.1
│ ├── debug#0.7.4
│ ├── fresh#0.2.0
│ ├── methods#0.1.0
│ ├── mkdirp#0.3.5
│ ├── range-parser#0.0.4
│ └─┬ send#0.1.4
│ └── mime#1.2.11
├─┬ jade#1.0.0
│ ├── character-parser#1.2.0
│ ├── commander#2.0.0
│ ├─┬ constantinople#1.0.2
│ │ └─┬ uglify-js#2.4.8
│ │ ├── async#0.2.9
│ │ ├─┬ optimist#0.3.7
│ │ │ └── wordwrap#0.0.2
│ │ ├─┬ source-map#0.1.31
│ │ │ └── amdefine#0.1.0
│ │ └── uglify-to-browserify#1.0.1
│ ├── mkdirp#0.3.5
│ ├─┬ monocle#1.1.50
│ │ └─┬ readdirp#0.2.5
│ │ └─┬ minimatch#0.2.14
│ │ ├── lru-cache#2.5.0
│ │ └── sigmund#1.0.0
│ ├─┬ transformers#2.1.0
│ │ ├─┬ css#1.0.8
│ │ │ ├── css-parse#1.0.4
│ │ │ └── css-stringify#1.0.5
│ │ ├─┬ promise#2.0.0
│ │ │ └── is-promise#1.0.0
│ │ └─┬ uglify-js#2.2.5
│ │ ├─┬ optimist#0.3.7
│ │ │ └── wordwrap#0.0.2
│ │ └─┬ source-map#0.1.31
│ │ └── amdefine#0.1.0
│ └─┬ with#2.0.0
│ └─┬ uglify-js#2.4.0
│ ├── async#0.2.9
│ ├─┬ optimist#0.3.7
│ │ └── wordwrap#0.0.2
│ ├─┬ source-map#0.1.31
│ │ └── amdefine#0.1.0
│ └── uglify-to-browserify#1.0.1
├── simple-recaptcha#0.0.3 extraneous
└─┬ stylus#0.41.3
├── cssom#0.2.5
├── debug#0.7.4
├── mkdirp#0.3.5
└── sax#0.5.8
npm ERR! extraneous: ejs#0.8.5 /Users/juan.gallardo/Desktop/myfiles/test-projects/bruxzir-express-test/node_modules/ejs
npm ERR! extraneous: simple-recaptcha#0.0.3 /Users/juan.gallardo/Desktop/myfiles/test-projects/bruxzir-express-test/node_modules/simple-recaptcha
npm ERR! not ok code 0
I resolved this just by listing EJS and its version into my package.json .
"ejs": "0.8.5"
If you do not know the version of EJS that you have, the way I found mine was to run npm list.
Here is my current entire file if you are curious how it all fits in together to deploy on heroku.
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "3.4.4",
"jade": "*",
"stylus": "*",
"ejs": "0.8.5"
},
"engines": {
"node": "0.10.1",
"npm": "1.3.14"
}
}

Resources