How can I get nasm to work as a command in terminal in MacOS?

丶灬走出姿态 提交于 2020-07-05 03:32:05

问题


I have been trying to get nasm to work as a command in terminal, but nothing seems to be working. I just keep getting the error:

nasm: error: unable to find utility "nasm", not a developer tool or in PATH

So, first, I tried updating my PATH variable. I tried editing the PATH variable:

safecrackers-MacBook-Pro-2:Library safecracker$ export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Libraries/nasm-2.14/
safecrackers-MacBook-Pro-2:Library safecracker$ nasm
nasm: error: unable to find utility "nasm", not a developer tool or in PATH
safecrackers-MacBook-Pro-2:Library safecracker$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Libraries/nasm-2.14/
safecrackers-MacBook-Pro-2:Library safecracker$ cd /Library/Libraries/nasm-2.14/
safecrackers-MacBook-Pro-2:nasm-2.14 safecracker$ ls
LICENSE     man1        ndisasm     rdf2ihx     rdfdump
README      nasm        rdf2bin     rdf2ith     rdflib
ldrdf       nasmdoc.pdf rdf2com     rdf2srec    rdx

I got the same error. Next, I tried installing nasm with homebrew:

safecrackers-MacBook-Pro-2:~ safecracker$ brew reinstall nasm
==> Reinstalling nasm 
==> Downloading https://homebrew.bintray.com/bottles/nasm-2.14.02.mojave.bottle.tar.gz
Already downloaded: /Users/safecracker/Library/Caches/Homebrew/downloads/8581149c56e4f6aa40f6c17f75921aeec141f01373082bda3c7c8afa5cf5fbd5--nasm-2.14.02.mojave.bottle.tar.gz
==> Pouring nasm-2.14.02.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/nasm/2.14.02: 30 files, 2.7MB
safecrackers-MacBook-Pro-2:~ safecracker$ nasm
nasm: error: unable to find utility "nasm", not a developer tool or in PATH

Again, I got the same error. I would love to finally figure this out.


回答1:


To avoid /usr/bin/nasm be found first in PATH use

$ /usr/local/bin/nasm

to find the one installed by brew, or

alias nasm=/usr/local/bin/nasm

and then

$ nasm



回答2:


I have solved this problem by:

brew reinstall nasm



回答3:


I solved the issue with

sudo chown -R "your_username_folder" /usr/local/share/man/man8 

On terminal

My brew was not configured properly, after this command and

brew install nasm

My NASM command is working properly

Done on MacOS Mojave Beta 4



来源:https://stackoverflow.com/questions/53974320/how-can-i-get-nasm-to-work-as-a-command-in-terminal-in-macos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!