eslint-plugin-react-redux icon indicating copy to clipboard operation
eslint-plugin-react-redux copied to clipboard

Invalid main field in package.json

Open crankoide opened this issue 3 years ago • 7 comments

The main field in package.json points to a file that is not existent in the published package. Since using Node.js 16 I get following warning when ESLinting my code.

(node:1169) [DEP0128] DeprecationWarning: Invalid 'main' field in '/<project name>/node_modules/eslint-plugin-react-redux/package.json' of 'dist/index.js'. Please either fix that or report it to the module author

crankoide avatar Nov 18 '21 07:11 crankoide

Seems like a duplicate of #74.

ljharb avatar Nov 18 '21 07:11 ljharb

Seems like a duplicate of #74.

Yes, but #74 has been closed without solving it. The main field value is wrong because the referenced dist folder is not existent within the published package.

crankoide avatar Nov 18 '21 07:11 crankoide

Sure, but it can be reopened instead of filing a duplicate :-)

Which exact version of the package do you have?

ljharb avatar Nov 18 '21 07:11 ljharb

ah, i see that the dist folder is missing in https://unpkg.com/browse/[email protected]/

@DianaSuvorova, you may need to add a prepublishOnly script to ensure the build runs prior to publishing.

ljharb avatar Nov 18 '21 07:11 ljharb

Sure, but it can be reopened instead of filing a duplicate :-)

Which exact version of the package do you have?

Didn't find the reopen button. 😄 I guess it's reserved for the collaborators?

I use the latest package v3.3.2. Node.js v16.13.0.

crankoide avatar Nov 18 '21 07:11 crankoide

(a comment asking for it to be reopened is usually sufficient)

ljharb avatar Nov 18 '21 07:11 ljharb

Even though https://github.com/DianaSuvorova/eslint-plugin-react-redux/pull/81 was merged, this still seems to be an issue in 3.3.4 with the dist folder created, because package.json main points to dist/index.js, which doesn't exist.

https://github.com/DianaSuvorova/eslint-plugin-react-redux/blob/16734b82768958c27f3d1c6ae8b3c7b69af0be39/package.json#L12 https://github.com/DianaSuvorova/eslint-plugin-react-redux/blob/v3.3.4/package.json#L12

srt4rulez avatar Jan 30 '22 21:01 srt4rulez