I want to be able to view MUI's components library and api docs on my mac while I'm offline. I was given the below instructions by MUI support
This is what I put into my terminal.
git clone https://github.com/mui-org/material-ui.git
cd material-ui
yarn
yarn docs:build
yarn docs:start
this is what I get out of my terminal
apple2#apple2s-iMac material-ui % yarn docs:start
yarn run v1.22.10
$ yarn workspace docs start
$ next start
Error: listen EADDRINUSE: address already in use 0.0.0.0:3000
at Server.setupListenHandle [as _listen2] (node:net:1330:16)
at listenInCluster (node:net:1378:12)
at doListen (node:net:1516:7)
at processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: 'EADDRINUSE',
errno: -48,
syscall: 'listen',
address: '0.0.0.0',
port: 3000
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /usr/local/Cellar/node/17.3.0/bin/node
Arguments: /Users/apple2/Desktop/Code/material-ui/.yarn/releases/yarn-1.22.10.js start
Directory: /Users/apple2/Desktop/Code/material-ui/docs
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
apple2#apple2s-iMac material-ui %
should I add the terminal outputs for each command input? (yarn docs:build is a large number of lines)
The error message EADDRINUSE is telling you that you already have something listening on port 3000. You need to stop the process/application currently using port 3000 so you can run MUI docs or tell MUI docs to use another port.
You can do one of the following:
Tell MUI docs to run on a different port: yarn docs:start --port=3001 (This is probably your best option.)
Look for the application (probably another terminal window -- your other React app?) and stop it (Ctrl + C)
Reboot your machine and make sure that nothing starts up listening on port 3000.
Find the process id in terminal and kill it manually.
To find the process id in terminal and kill it manually, open up terminal on your Mac and type the following commands:
Get a list of any processes listening on port 3000 (sudo will require you to enter your password)
sudo lsof -i :3000
A list of processes currently listening on port 3000 will be displayed. For example:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 53763 [your username] 28u IPv4 0x6c9dbf461b729ff1 0t0 TCP *:hbci (LISTEN)
Find the process id (PID) in the list for the process you want to kill -- in the example above, the process id is "53763".
Kill the process:
kill -9 53763
Now try to re-run MUI docs:
yarn docs:start
Related
I'm using a MacBook Pro and recently I have come across this issue while running VSCode.
Although, I kill the port on the VSCode integrated terminal, but it's still running somewhere in the background.
Is there a way to kill ports when you kill it on VSCode, so I don't have to do the npx kill-port 5000 for instance?
I've run this command npx kill-port 5000 on Terminal, but it seems like it doesn't kill the port.
I get this error, when I run another project on VSCode:
Emitted 'error' event on WebSocketServer instance at:
at Server.emit (node:events:538:35)
at emitErrorNT (node:net:1357:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'EADDRINUSE',
errno: -48,
syscall: 'listen',
address: '::',
port: 5000
}
After installing druid and zookeeper on MacOSX 10.12, I am unable to get the overlord process to run as instructed.
java `cat conf-quickstart/druid/overlord/jvm.config | xargs` -cp "conf-quickstart/druid/_common:conf-quickstart/druid/overlord:lib/*" io.druid.cli.Main server overlord
I get the error that the address is already in use.
Method 1 quit the app using the port:
Check to see what application is running on port 8090 (this is the default). Run lsof -i :8090 | grep LISTEN to get the resulting pid. Use the pid to see if the application is one you can close ps -ef pid. If so, close/kill it. If not, try method 2.
Method 2 change the druid configuration:
Use and editor to open and edit the runtime configuration for overlord. Change the default port given to something else, like 8099.
vim conf-quickstart/druid/overlord/runtime.properties
When trying to run
tns run android --device xxxx
I always get an err like this:
Error: error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
at Socket.<anonymous> (C:\Users\Raziff\AppData\Roaming\npm\node_modules\nativescript\lib\common\mobile\mobile-core\android-device-discovery.js:54:25)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)
at Pipe.onread (net.js:523:20)
Any way to fix this. I've tried it with various devices.
Have you checked your port? Your port which is 5037 probably is being used by other application. You can check your port using Windows Task Manager.
When you run tns more than 2 times It sometimes consumes your port, the thing you need to do is to run
netstat -a -o -n
You will get the list of tasks running on your machine.
You need to look for the 5037 port in the local address column, after you find it, check the process ID (PID) of the task.
Then kill it with
taskkill /f /pid 123456
Now you can continue with developement :)
What I discovered was there was a difference in ADB versions being used throughout the system. Here is the command I used to find them:
where /r C:\ adb.exe
This produced the results:
C:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
C:\Program Files\Genymobile\Genymotion\tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb backup\adb.exe
Navigating to each directory and running:
adb.exe version
Allowed me to see that Expo was running ADB version:
Android Debug Bridge version 1.0.36
Revision fd9e4d07b0f5-android
While Genymotion using the custom SDK had version (c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe):
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
As a test I took the adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) from
c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
and placed them into a backup folder. I then moved the adb files located at
c:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
into that same location. I killed adb with:
adb kill-server
which caused a restart of the adb server automatically due to having my Genymotion device already running. I hit the "Restart" button inside of the Expo XDE and it immediately began working. Here is the log where I hit the restart button at 1:13:04 AM:
simply all adb.exe files must have same versions.
I've had no luck in starting the postgres server. I can add new databases, tables, etc to the postgres from the terminal, but can't add things to the tables through a webpage. The webpage is running on a localhost for now.
The postgres data folder was originally created in a root user, but I moved it to my own user account and it solved many problems, but I'm back at the same old error I keep getting after entering postgres -D data (data being the data cluster folder)
EDT LOG: could not bind IPv4 socket: Address already in use
2015-06-18 11:11:35 EDT HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2015-06-18 11:11:35 EDT LOG: could not bind IPv6 socket: Address already in use
2015-06-18 11:11:35 EDT HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2015-06-18 11:11:35 EDT WARNING: could not create listen socket for "*"
2015-06-18 11:11:35 EDT FATAL: could not create any TCP/IP sockets
I tried two different commands to start the server.
pg_ctl -D data -l logfile start
which gave me this, but it's not correct
server starting
and
pg_ctl -D /Library/PostgreSQL/9.4/data -l log file start
which gave me this
LOG: skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf"
pg_ctl: another server might be running; trying to start server anyway
server starting
The postgresql.auto.conf file is most definitely there with correct name and everything. If I try to stop the supposedly started server it results in this with the first one from the first command I tried and the second stop with the second command.
Is server running?
and
LOG: skipping missing configuration file "/Library/PostgreSQL/9.4/data/postgresql.auto.conf"
pg_ctl: could not send stop signal (PID: 83): Operation not permitted
Something seems to already use port 5432.
Try to find out, which program (maybe another instance of postgres) is blocking that port and decide whether to stop that other process, or not.
As an alternative reconfigure postgres to use other ports.
Maybe you can find out, what is blocking that port by typing this into the console:
lsof -n -i4TCP:5432 | grep LISTEN
Its clear that there is another instance of postgres running. You have to stop that one before starting yours manually as this will go in conflict with the port numbers.
sudo launchctl stop com.edb.launchd.postgresql-9.4
The try and launch with your command.
I tried to install mongoDB on my macbook air.
I've downloaded zipped file from official website and extract that file and move to root directory.
After that, under that directory, I've made /data/db and /log folder.
Here is my mongodb.config which describes the basic config for my DB.
dbpath = /mongodb/data/db
logpath = /mongodb/log/mongo.log
logappend = true
#bind ip = 127.0.0.1
port = 27017
fork = true
rest = true
verbose = true
#auth = true
#noauth = true
Additionally, I want to know what the # means in the config file.
I put this file to /mongodb/bin, /mongodb is the directory I extracted the files into.
I opened terminal and entered ./mongod --config mongodb.config and I got this back.
Juneyoung-ui-MacBook-Air:bin juneyoungoh$ ./mongod --config mongodb.config
about to fork child process, waiting until server is ready for connections.
forked process: 1775
all output going to: /mongodb/log/mongo.log
ERROR: child process failed, exited with error number 100
How can I handle this error and what this means?
The data folders you created were very likely created with sudo, yes? They are owned by root and are not writable by your normal user. If you are the only user of your macbook, then change the ownership of the directories to you:
sudo chown juneyoungoh /data
sudo chown juneyoungoh /data/db
sudo chown juneyoungoh /data/log
If you plan on installing this on a public machine or somewhere legit, then read more about mongo security practices elsewhere. I'll just get you running on your macbook.
I had a similar issue and it was not related to any 'sudo' problem. I was trying to recover from a kernel panic!
When I look at my data folder I found out a mongod.lock file was there. In my case this page helped a lot: http://docs.mongodb.org/manual/tutorial/recover-data-following-unexpected-shutdown/. As they explain,
if the mongod.lock is not a zero-byte file, then mongod will refuse to start.
I tested this solution in my environment and it works perfectly:
Remove mongod.lock file.
Repair the database: mongod --dbpath /your/db/path --repair
Run mongod: mongod --dbpath /your/db/path
There was the same problem on my machine. In the log file was:
Mon Jul 29 09:57:13.689 [initandlisten] ERROR: Insufficient free space for journal file
Mon Jul 29 09:57:13.689 [initandlisten] Please make at least 3379MB available in /var/mongoexp/rs2/journal or use --smallfiles
It was solved by using mongod --smallfiles. Or if you start mongod with --config option than in a configuration file disable write-ahead journaling by nojournal=true (remove the beginning #). Some more disk space would also solve the above problem.
It's because you probably didn't shutdown mongodb properly and you are not starting mongodb the right way. According your mongodb.config, you have dbpath = /mongodb/data/db - so I assume you created the repository /mongodb/data/db? Let me clarify all the steps.
TO START MONGODB
In your mongodb.config change the dbpath = /mongodb/data/db to dbpath = /data/db. On your terminal create the db repository by typing: mkdir /data/db. Now you have a repository - you can start your mongo.
To start mongo in the background type: mongod --dbpath /data/db --fork --logpath /dev/null.
/data/db is the location of the db.
--fork means you want to start mongo in the background - deamon.
--logpath /dev/null means you don't want to log - you can change that by replacing /dev/null to a path like /var/log/mongo.log
TO SHUTDOWN MONGODB
Connect to your mongo by typing: mongo and then use admin and db.shutdownServer(). Like explain in mongoDB
If this technique doesn't work for some reason you can always kill the process.
Find the mongodb process PID by typing: lsof -i:27017 assuming your mongodb is running on port 27017
Type kill <PID>, replace <PID> by the value you found the previous command.
Similar issue with the same error - I was trying to run the repair script
sudo -u mongodb mongod -f /etc/mongodb.conf --repair
Checked ps aux | grep mongo and see that the daemon was running. Stopped it and then the repair script run without an issue.
Hope that could be helpful for someone else.
I had the same error on linux (Centos) and this worked for me
Remove mongod.lock from the dbpath
$ rm /var/lib/mongo/mongod.lock
Repair the mongod process
$ mongod --repair
Run mongod config
$ mongod --config /etc/mongod.conf
I had the same error. I ran it interactively to see the log.
2014-10-21T10:12:35.418-0400 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
Then I used lsof to find out which process was using my port.
$ lsof -i:27017
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mongod 2106 MYUSERID 10u IPv4 0x635b71ec3b65b4a1 0t0 TCP *:27017 (LISTEN)
It was a mongod that I had forked previously and forgot to turn off (since I hadn't seen it running in my bash window).
Simply killing it by running kill 2106, enabled my process to run without the error 100.
Generally, this error comes when the mongod.conf file is not able to
find a certain path for
Database store
or log store
or maybe processid store
or maybe it's not getting the file permission to access the config directories and files which has been declared in mongod.conf
to resolve this error we need to observe the log generated by the MongoDB
it will clearly indicate whether which file or directory you MongoDB is not able to access
the above error may look like below screenshot
create folder "data" and "db" inside it, in "/" path of your server.
actually you should create or modify permissions of folder that the data is going to be stored!