Cannot read property 'replace' of undefined error

375 views
Skip to first unread message

Aryak Sengupta

unread,
Mar 31, 2015, 10:14:14 AM3/31/15
to nod...@googlegroups.com
Hi everyone, 
 
I am trying to run the GetStream/stream-nodejs example app of getStream.io . But I am facing the following error. 



var STREAM_URL = process.env.STREAM_URL.replace(/[@=:]/g, '/').split('/');
                                       ^
TypeError: Cannot read property 'replace' of undefined
    at Object.<anonymous> (E:\Mean.js stuffs\stream-nodejs\config\config.js:5:40
)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (E:\Mean.js stuffs\stream-nodejs\app.js:3:14)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! Str...@1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Str...@1.0.0 start script 'node app.js'.
npm ERR! This is most likely a problem with the Stream package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls Stream
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Mean.js stuffs\stream-nodejs\npm-debug.log


Any help regarding this will be appreciated. Thanks


P.S. - I am very new to NodeJS. 

Phillip Johnsen

unread,
Apr 1, 2015, 4:45:30 PM4/1/15
to nod...@googlegroups.com
Hi Aryak,

the app obviously has to be configured with an environment variable set, named $STREAM_URL.

You can set the value of $STREAM_URL while starting the application as follows:

$ STREAM_URL=http://possibly.getstream.io/url npm start

I dont know what getstream.io is and what kind of "stream URL" the app expects, but hopefully this gave you some hints as to getting the app running?

- Phillip
Reply all
Reply to author
Forward
0 new messages