Comments (7)
I tried
sudo ./npm install [email protected]
And seems successfully installed, hope this help others. haven't test it with any js at the moment. will update if errors found later.
from websocket-node.
Oh, it seems not able to find the module websocket in JS
./npm list
/home/roger/node-v0.8.8-linux-x64/bin
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
└── [email protected]
module.js:340
throw err;
^
Error: Cannot find module 'websocket'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object. (/home/roger/node-v0.8.8-linux-x64/js/websocketserver.js:2:23)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
Any help...?
from websocket-node.
I installed in ubuntu12:
/node-v0.8.8-linux-x64/
from websocket-node.
I test it with a single line JS file.
var WebSocketServer = require('websocket').server;
from websocket-node.
case closed, just need to setup NODE_PATH
from websocket-node.
This is all because of a combination of two things:
1.) You didn't install node.js in the default system-wide location. That would have made your life much easier. Alternatively, if you don't want it installed system-wide, but still want the convenience of using multiple node versions and keeping them separated, look at using "nvm" to install Node.
2.) From the way you were running the npm command, you weren't using it correctly. You appear to have been running npm from within the directory where node's binaries are installed. That's not right. What you have to understand about node's package manager is that, unlike other package managers such as from python, ruby, and perl, node packages are never installed "system-wide" unless you explicitly pass the "-g" flag to npm. Even then, the majority of them are not designed to be installed system-wide. You run "npm install websocket" from within your individual project directory, and npm will install the module at the current version into that project. You have to install every module you need into every project directory that uses it. That allows you to avoid version conflicts entirely. You can automate the process by creating a "package.json" file in your project directory that lists all its dependencies, and then you can just run "npm install" and it'll recursively install all the module dependencies into the current project directory.
from websocket-node.
Really thank you, that clarify a lot of things for me.
from websocket-node.
Related Issues (20)
- The NPM package is not a place for politics HOT 1
- The NPM package is not a place for politics HOT 2
- Get URL Parameters HOT 1
- Ssl using cloudflare
- Send bytes query
- broadcast
- How to connect to multiple WebSockets? HOT 1
- install of websocket and immediatly disapear
- How Can we get Connection URL from w3cwebsocket to webSocket.Server Connection
- Similar to emit socket.io HOT 1
- send to all connected clients HOT 2
- Getting vulnerable issue [email protected]
- Need more docs on the usage of client
- Unable to connect with auth info in url and special characters HOT 1
- connection.on('message', ...) - where this event is emitted ? HOT 1
- This pkg appears abandoned. I recommend switching to "ws", it's a very similar implementation HOT 4
- Malware dependency
- Update UTF-8 Validation Code
- Request to Upgrade es5-ext Dependency to Resolve Veracode Vulnerability HOT 5
- websocket doesn't work under bun HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from websocket-node.