Have you created a package.json file? Maybe run this command first again.
C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm init
It creates a package.json file in your folder.
Then run,
C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm install socket.io --save
The --save
ensures your module is saved as a dependency in your package.json file.
Let me know if this works.
Related Posts:
- How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
- NPM ELIFECYCLE error – using node server.js command
- Node.js – SyntaxError: Unexpected token import
- After $npm install, Getting Error: Cannot find module ‘../lib/utils/unsupported.js’
- Node.js – SyntaxError: Unexpected token import
- Node.js Port 3000 already in use but it actually isn’t?
- npm – EPERM: operation not permitted on Windows
- keep getting “? Something is already running on port 3000” when I do npm start on react app
- How to use npm jquery module?
- SyntaxError: Cannot use import statement outside a module
- Node update a specific package
- Cannot find module ‘internal/fs’ after upgrading to node 7
- Maximum call stack size exceeded on npm install
- NPM install fails with node-gyp
- events.js: 141 throw er; // Unhandled ‘error’ event
- How can I update NodeJS and NPM to the next versions?
- After command npm start “Missing script:start” error
- How can a Discord bot create a hyperlink in a Discord message in an embed or in general? [closed]
- Babel 6 regeneratorRuntime is not defined
- TypeError: Converting circular structure to JSON in nodejs
- Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai
- Difference between npx and npm?
- Client on Node.js: Uncaught ReferenceError: require is not defined
- How can a Discord bot create a hyperlink in a Discord message in an embed or in general?
- Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai
- require is not defined? Node.js
- Client on Node.js: Uncaught ReferenceError: require is not defined
- Error: Can’t set headers after they are sent to the client
- Express error – TypeError: Router.use() requires middleware function but got a Object
- What is NODE_ENV and how to use it in Express?
- Node.js heap out of memory
- Reactjs – Form input validation
- await is only valid in async function
- How to set NODE_ENV to production/development in OS X
- await is only valid in async function
- Heroku: “No default language could be detected for this app” error thrown for node app
- Heroku: “No default language could be detected for this app” error thrown for node app
- What does “res.render” do, and what does the html file look like?
- How to obtain username from Promise
? - ReferenceError: fetch is not defined
- SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag
- Invalid shorthand property initializer
- webpack: Module not found: Error: Can’t resolve (with relative path)
- nodejs – error self signed certificate in certificate chain
- What’s the source of Error: getaddrinfo EAI_AGAIN?
- stop all instances of node.js server
- Using Node.js require vs. ES6 import/export
- ReferenceError : window is not defined at object.
Node.js - Why is process.env.NODE_ENV undefined?
- Javascript require() function giving ReferenceError: require is not defined
- Unable to verify leaf signature
- How can I mock an ES6 module import using Jest?
- What Are “npm run dev” and “npm run prod”
- TypeError: Router.use() requires middleware function but got a Object
- TypeError: app.use() requires middleware functions
- Node.js document is not defined
- How to determine the installed webpack version
- node.js TypeError: path must be absolute or specify root to res.sendFile [failed to parse JSON]
- How to properly export an ES6 class in Node 4?
- Express error – TypeError: Router.use() requires middleware function but got a Object
- Expressjs / Node.js – res.redirect() not loading page
- Using async/await with a forEach loop
- Failed to compile. Module not found: Can’t resolve ‘react-router-dom’
- MissingSchemaError: Schema hasn’t been registered for model “User”
- npm WARN … requires a peer of … but none is installed. You must install peer dependencies yourself
- Convert Array to Object
- Basic Ajax send/receive with node.js
- Npm install cannot find module ‘semver’
- How to download a file with Node.js (without using third-party libraries)?
- Make Axios send cookies in its requests automatically
- How do I remove documents using Node.js Mongoose?
- node-request – Getting error “SSL23_GET_SERVER_HELLO:unknown protocol”
- node-request – Getting error “SSL23_GET_SERVER_HELLO:unknown protocol”
- Why does JSHint throw a warning if I am using const?
- How to fix Cannot find module ‘typescript’ in Angular 4?
- Difference between “module.exports” and “exports” in the CommonJs Module System
- Local package.json exists, but node_modules missing
- Error: Cannot find module html
- How to access the request body when POSTing using Node.js and Express?
- TypeError: res.status is not a function
- TypeError: res.json is not a function
- Eslint: How to disable “unexpected console statement” in Node.js?
- How can I use webpack with express?
- SyntaxError: Use of const in strict mode
- How do you completely remove Ionic and Cordova installation from mac?
- Error: listen EACCES 0.0.0.0:80 OSx Node.js
- How to sort in mongoose?
- How to format a UTC date as a `YYYY-MM-DD hh:mm:ss` string using NodeJS?
- What counts as CPU Intensive tasks (eg. sorting, searching etc?)
- How to convert binary string to decimal?
- How to disable auto-start of “Node.js: Server-side JavaScript” when using Adobe Dreamweaver?
- “React.Children.only expected to receive a single React element child” error when putting
and in a - What is the difference between Bower and npm?
- How do I install Angular 2 using NPM?
- How to fix “TypeError: Right-hand side of ‘instanceof’ is not callable” when I use another module class?
- Error: Couldn’t find preset “es2015” relative to directory “/Users/username”
- Using Angular 2 without TypeScript Transpiler
- how to add inside a text box?
- DeprecationWarning: Calling an asynchronous function without callback is deprecated. – how to find where the “function:” is?
- Is there a way to create interfaces in ES6 / Node 4?