Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: explain error message on missing main file #5812

Closed
wants to merge 1 commit into from

Conversation

drywolf
Copy link
Contributor

@drywolf drywolf commented Mar 20, 2016

Description of change

Added a hint to documentation saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.

for details see: #5758

@MylesBorins
Copy link
Contributor

LGTM

edit: added a nit regarding wrapping lines, if that is followed then LGTM stands

@@ -346,6 +346,12 @@ If this was in a folder at `./some-library`, then

This is the extent of Node.js's awareness of package.json files.

Note: If the file specified by the `"main"` entry of `package.json` is missing and can not be resolved, node will report the entire module as missing with the default error:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you wrap this at 80 characters. you will notice this is the longest line in the file

@drywolf
Copy link
Contributor Author

drywolf commented Mar 20, 2016

I realized it as well after I created the PR, I added another commit with properly wrapped lines. 😉

@MylesBorins
Copy link
Contributor

@drywolf would you be able to squash those into a single commit please.

@MylesBorins MylesBorins added the doc Issues and PRs related to the documentations. label Mar 20, 2016
@drywolf drywolf force-pushed the package-json-main-error-doc branch from f806d26 to 85f9b40 Compare March 20, 2016 21:40
@drywolf
Copy link
Contributor Author

drywolf commented Mar 20, 2016

@thealphanerd done.

@benjamingr
Copy link
Member

LGTM

@jasnell
Copy link
Member

jasnell commented Mar 21, 2016

LGTM with a nit

@@ -346,6 +346,14 @@ If this was in a folder at `./some-library`, then

This is the extent of Node.js's awareness of package.json files.

Note: If the file specified by the `"main"` entry of `package.json` is missing
and can not be resolved, node will report the entire module as missing with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit: s/node/Node.js/

Added a hint saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.
@drywolf drywolf force-pushed the package-json-main-error-doc branch from 85f9b40 to ba95e02 Compare March 21, 2016 19:00
@drywolf
Copy link
Contributor Author

drywolf commented Mar 21, 2016

@jasnell fixed s/node/Node.js/

jasnell pushed a commit that referenced this pull request Mar 21, 2016
Added a hint saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.

PR-URL: #5812
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Mar 21, 2016

Landed in f70c71f

@jasnell jasnell closed this Mar 21, 2016
Fishrock123 pushed a commit that referenced this pull request Mar 22, 2016
Added a hint saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.

PR-URL: #5812
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2016
Added a hint saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.

PR-URL: #5812
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Mar 30, 2016
Added a hint saying that node uses the default "Cannot find module"
error when requiring a module for which the "main" file specified in
the package.json is missing.

PR-URL: #5812
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants