Errors installing socket.io for node.js - node.js

I installed node on my windows 8 machine with no problems and then went to install the socket.io package to use for an assignment. After typing
npm install socket.io
I got a huge amount of errors.
What I've tried so far:
this - nodejs npm install socket.io error
and this - NPM - Can't install socket.IO
The first answer in both.
A lot of the other stuff I'm finding is for either windows 7 or Mac so I'm not sure if this is just a windows 8 thing.

As you can see in logs you have a permission error. Script doesn't have enough permissions to create directory in C:\\Program_Files\.... Use other directory instead or run command with Admin permissions.

Try running
npm install socket.io
except this time run the command line as an administrator. You can do this in Windows 8 by going to your app search, typing cmd, right-clicking then click 'Run as administrator'.
I feel this is the issue because your error message says 'Please try running this command again as root/Administrator'.

Related

Failing to install Alexa ASK-CLI "request deprecated"

I took a screenshot of the error message(s) I'm getting when trying to install the Alexa ask-cli.
typed in the command in terminal exactly like it says so in the guide
I also have a current version of node.js which is required.
First of all, “request deprecated” is not the reason which causes the failure of installation. Because ask-sdk is using it so you get the warning. you can find more Here
The problem is, the terminal you used did not have necessary permissions to access the /node_modules folder.
If you follow the instructions, are you sure that you ran the terminal with Run as Administrator option (in Windows) or sudo (in Unix)?
or you can try this:
sudo npm install -g --unsafe-perm=true --allow-root
then it should work perfectly

React: npm start - windows cannot find localhost

I am trying to follow tutorials for basic react-build-app.
ENVIRONMENT
I am using Ubuntu on Windows 10.
Node version: v13.3.0
NPM version: 6.13.1
So far I did,
npm install -g create-react-app
create-react-app calculator
cd calculator
npm start
PROBLEM
When I run npm start, I get pop up dialog from windows saying, Windows cannot find '\https://localhost:3000/\'. Make sure you typed the name correctly, and then try again.
Here is a screenshot of the error
However, in the cli, I see
Local: http://localhost:3000/
On Your Network: http://192.168.56.1:3000/
Note that the development build is not optimized.
To create a production build, use npm run build.```
But when I open my browser and go to http://localhost:3000/, I only see a blank page, and not the normal React logo.
EXPECTED OUTPUT
I should see the react logo when going to http://localhost:3000/, and not receive and error.
ATTEMPTS
Updated nodejs and npm.
Changed ports using package.json. Also tried
using .env file to change port. Same error.
Uninstalled and re-installed ubuntu 18.04 LTS and used NVM to install nodejs and npm.
WORKAROUND
I got tired of fixing error after error with linux, so I just set up npm and nodejs on windows instead. ran create-react-app on windows cli and it worked the first time. Told me something else was listening on the port i was trying to open, so prompted me to change port. I said yes. Now I get the landing page I was looking for.
I am very new at this and have been trying to figure this out for a couple days now, I would appreciate any advice. Thank you.
This is a WSL specific issue with one of the dependencies of react-scripts, more specifically open version 7.0.0.
To resolve, you can:
switch to react-scripts 3.2.0 in your package.json, or
run npm start from something else than WSL (e.g. Powershell), or
wait for open and react to fix the issue
Bug report in React Scripts:
https://github.com/facebook/create-react-app/issues/8081
And the corresponding bug report in open:
https://github.com/sindresorhus/open/issues/154
According to this post in the bug report in open the culprit is lines 76 & 77 of index.js in node_modules/open. If you comment them out then it works fine.
Link to comment:
https://github.com/sindresorhus/open/issues/154#issuecomment-562509596

Fail to install SASS using NPM

Error
I'm trying to install SASS on my machine using NPM, but I'm getting an error
You need to run the console as sudo (i see you are using LINUX or MAC), which are both UNIX-based systems or Run as administrator in windows.
If you take a look at the error you are getting it says permission denied and that you should try to run that as administrator/root.

How to run the Reactjs Web Application in localhost:3000 in windows

I'm a new React Developer, and I'm having a problem in running it to my chrome. I already did the npm install in cmd, and then I npm start by its not starting because of error in cmd. And my OS is Windows 10.
What should I do?
in your package.json file the script define rm command witch is not available in windows that's why you are getting error
insted of rm change it to del
and if there is any UNIX specific command then change it to windows equivalent

npm.cmd closes instantly after few seconds

I'm learning nodeJs. I managed to run nodejs commands on cmd and it works fine. Now I want to install express framework and for that in the tutorial I'm following it asks to type sudo install -g express on npm command prompt. So I typed npm in my windows search, and clicked on it. Right after few seconds less than 3 it closes straight away.
I found that npm.cmd exist in nodejs directory where node.exe found. What could be the problem here. If I were to type the above mentioned command in windows cmd, it says sudo is unrecognized program.SO must I use npm cmd?
After running cmd.exe , I guess you would have node installed but still run node -v , it should respond with the version meaning it's working.
Now if you want to explicitly install express.js you just have to run on, the command prompt itself,
npm install express -g.
Anyways you can follow this link from their official website. Hope it helps. Also sudo is a program for Unix like operating systems, just in case you needed it.

Resources