Q:

Error showing in Terminal "-bash: name: command not found"

the file is unable to assemble in macos terminal
Macbooks-MacBook-Air:Desktop macbook$ cd ~/Desktop
Macbooks-MacBook-Air:Desktop macbook$ nasm -f macho h1.asm

A:

Do you have installed? 
nasm for mac os
How to do this: How to install a specific version of NASM on MacOS
After that check it:
which nasm

