Needs cannot open a package

I have a package and notebook in the same directory, but Needs is throwing an error

"Cannot open EField.m".

I have tried several variations of this. I am using the following command in my notebook. The notebook and EField.m are in the same directory.

Needs["EKSModelEFields", "EField.m"]


The package is declared as:

BeginPackage["EKSModelEFields"]


Do we need to register packages when they are in the same directory?

• Is the directory on \$Path? Jun 3 '15 at 16:53

Try assembling the qualified file path with NotebookDirectory and FileNameJoin:
Needs["EKSModelEFields", FileNameJoin[{NotebookDirectory[], "EField.m"}]]