Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

File not found vs module not found #5

Closed
rogeliog opened this issue Aug 28, 2016 · 4 comments
Closed

File not found vs module not found #5

rogeliog opened this issue Aug 28, 2016 · 4 comments

Comments

@rogeliog
Copy link
Contributor

I have this code

import something from '../path/to/file';
import redux from 'redux';

But the error output is the following

These dependencies were not found in node_modules:

* ../path/to/file
* redux

Did you forget to run npm install --save for them?

It would be great if we could split this into two separate type of errors

Module not found

This dependency was not found in node_modules:

* redux

Did you forget to run npm install --save for it?

File not found

This file or directory as was not found

* ../path/to/file

For the file not found it would be quite interesting to search for that file in a one directory above and one directory below. For example for ../path/to/file we could check in ./path/to/file and ../../path/to/file. If we do something like this, then we could add that info to the output.

This file or directory as was not found

* ../path/to/file

Did you mean `../../path/to/file`?
@geowarin
Copy link
Owner

That's a great idea !
Why not using a running a glob on all sources (if we can determine we the sources are located)?
Would you be willing to submit a PR for this?

@rogeliog
Copy link
Contributor Author

Yeah! I'm going to be a bit busy for the first half of the week, but I'll work on it as soon as I have some time :)

@guox191
Copy link

guox191 commented Feb 21, 2017

+1, It's more precise

@geowarin
Copy link
Owner

geowarin commented Mar 1, 2017

Released in 1.6.0

@geowarin geowarin closed this as completed Mar 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants