Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83807db

Browse files
fix: clarify the file name to be used (#1170)
As I was following the steps in this page -https://docs.npmjs.com/creating-node-js-modules, I noticed the followingerror when using the published package in the test-directory:`Error: Cannot find module'D:\Learning\npm-docs\use-hello\node_modules\@andrewnessindev\hello\index.js'.Please verify that the package.json has a valid "main" entry`It turned out that I missed providing the main entry even though this[page already mentions to provideit](https://github.com/npm/documentation/blob/2e10e4ed46f0f58adf4c165e8ef21599bc3b325f/content/packages-and-modules/contributing-packages-to-the-registry/creating-node-js-modules.mdx?plain=1#L20).However, it might be more helpful if the docs clarify which file isreferred to when[ it says, "In thefile"](https://github.com/npm/documentation/blob/2e10e4ed46f0f58adf4c165e8ef21599bc3b325f/content/packages-and-modules/contributing-packages-to-the-registry/creating-node-js-modules.mdx?plain=1#L28).This is my first commit! I followed the instruction it the`contributing.md` file for the commit message. I did not see arequirement to raise an issue first! Please do let me know if I have toraise an issue first or if I have missed anything else.---------Co-authored-by: Gar <wraithgar@github.com>
1 parent2e10e4e commit83807db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎content/packages-and-modules/contributing-packages-to-the-registry/creating-node-js-modules.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For more information on `package.json` files, see "[Creating a package.json file
2525

2626
##Create the file that will be loaded when your module is required by another application
2727

28-
Inthe file, add a function as a property of the`exports` object. This will make the function available to other code:
28+
Create a file withthe same name you provided in the`main` field. In that file, add a function as a property of the`exports` object. This will make the function available to other code:
2929

3030
```
3131
exports.printMsg = function() {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp