sockjs/sockjs-node

package.json broken on example echo

Closed this issue · 3 comments

Hi,
We're trying to test your package and have been trying the example that suit our needs. We've encountered a dependency error during install

(node:23689) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT: no such file or directory, open '/home/pi/Documents/testwebsocket/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! System Linux 4.19.42-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/Documents/testwebsocket
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/Documents/testwebsocket/package.json
npm ERR! syscall open
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -2
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/Documents/testwebsocket/npm-debug.log
npm ERR! not ok code 0

We then tried installing the latest version available but as could be expected, we got an error of a function not existing:

/home/pi/Documents/testwebsocket/webserver.js:31
sockjs_echo.attach(server);
            ^

TypeError: sockjs_echo.attach is not a function
    at Object.<anonymous> (/home/pi/Documents/testwebsocket/webserver.js:31:13)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

We're using a raspberry pi and are trying to learn about websockets as part of a project, we are quite novice in this field, please pardon us if it's a silly issue. Could it be that our npm version is just outdated?

pi@raspberrypi:~/Documents/testwebsocket $ npm -v
1.4.21

Thanks in advance for any help

Best regards

There is a big warning on the README in master:

⚠️️ ATTENTION This is pre-release documentation. The documentation for the latest stable release is at: https://github.com/sockjs/sockjs-node/tree/v0.3.19 ️⚠️

Hi,
Thanks for the explanation, I feel stupid and thanks for your awesome library!

@nazmifr it's ok bro i ended up here too :)
didn't just happen to u lol