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

[NodeJs16] DeprecationWarning: Invalid 'main' field #7

Open
alexhaller opened this issue Jun 4, 2021 · 19 comments
Open

[NodeJs16] DeprecationWarning: Invalid 'main' field #7

alexhaller opened this issue Jun 4, 2021 · 19 comments

Comments

@alexhaller
Copy link

alexhaller commented Jun 4, 2021

Hi,
Since Nodejs 16 I am getting following DeprecationWarning: Invalid 'main' field in '\node_modules\objectorarray\package.json' of 'dist/index.js'. Could you please fix that?
Thank you!
Alexander

@rdominic
Copy link

rdominic commented Jun 8, 2021

Also seeing this.

@zhouhanseng
Copy link

@alexhaller @rdominic

Fixed by zhouhanseng@d5021ac.

[email protected] released.

PS. Could you please help me to close this issue, since I lost my 2 factor authentic token, this project has moved to https://github.com/zhouhanseng/objectorarray

@BRAVO68WEB
Copy link

Same here

node - v16.5.0
npm - 7.20.1

@BRAVO68WEB
Copy link

Still not fixed

@Fourie-r
Copy link

same here

@almothafar
Copy link

almothafar commented Aug 31, 2021

@zhouhanseng it is still NOT fixed, 1.0.5 here and getting:

(node:423) [DEP0128] DeprecationWarning: Invalid 'main' field in '/home/almothafar/.npm-global/lib/node_modules/cordova/node_modules/objectorarray/package.json' of 'dist/index.js'. Please either fix that or report it to the module a
uthor
(Use `node --trace-deprecation ...` to show where the warning was created)

Also why we can't open any issue in your new repo?

@satyamgchetu
Copy link

satyamgchetu commented Sep 18, 2021

(node:1632) [DEP0128] DeprecationWarning: Invalid 'main' field in 'D:\satyamg\react-tsx-electron\node_modules\eslint-config-airbnb-typescript\package.json' of 'dist/eslint-config-airbnb-typescript.js'. Please either
fix that or report it to the module author
(Use node --trace-deprecation ... to show where the warning was created)

how to solve this

@afeurra
Copy link

afeurra commented Jan 28, 2022

Just follow the path to the broken package.json and change from
"main": "dist/index.js",
to
"main": "index.js",

@carmcha
Copy link

carmcha commented Mar 13, 2022

Go to
C:\Users[yourusername]\AppData\Roaming\npm\node_modules@aws-amplify\cli\node_modules\cloudform\package.json

change
"main": "packages/cloudform/index.js",
to
"main": "index.js",

@aniketsingh30
Copy link

Thanks @carmcha. Not getting deprecate warning message now.

@aniketsingh30
Copy link

Is there any fix for this An error occurred during the push operation: Unexpected token 'export' @carmcha

@LEOJESUSMENA
Copy link

Go to C:\Users[yourusername]\AppData\Roaming\npm\node_modules@aws-amplify\cli\node_modules\cloudform\package.json

change "main": "packages/cloudform/index.js", to "main": "index.js",
This fixed it for me.. Thank you.
However, I landed here originally because my AppSync is not actually updating the offline data to the cloud, or vice versa, and I thought this could have been the reason.
I still get no Sync with the cloud. I have run pulls and pushes, as well as amplify update api.
Anyone who could help??? BTW, I am new to Expo cli and Amplify-aws.
Thanks so much

@LEOJESUSMENA
Copy link

Go to C:\Users[yourusername]\AppData\Roaming\npm\node_modules@aws-amplify\cli\node_modules\cloudform\package.json

change "main": "packages/cloudform/index.js", to "main": "index.js",

This fixed it for me.. Thank you @carmcha !!!!
However, I landed here originally because my AppSync is not actually updating the offline data to the cloud, or viceversa, and I thought this could be the reason.
I still get no Sync with the cloud. I have run pulls and pushes, as well as amplify update api.
Anyone who could help??? BTW, I am new to Expo cli and Amplify-aws.
Thanks so much

@MuhAssar
Copy link

MuhAssar commented Apr 2, 2022

same, getting this error in Cordova iOS app

fixed by changing /dist/index.js to just index.js in package.json of this package

@meesii
Copy link

meesii commented Apr 3, 2022

Modules that have an invalid main entry (e.g., ./does-not-exist.js) and also have an index.js file in the top level directory will resolve the index.js file. That is deprecated and is going to throw an error in future Node.js versions.

https://nodejs.org/api/all.html#DEP0128

@DavLomen
Copy link

reduced node version to 14.6.0

@the-code-genin
Copy link

Downgrading to node 14 fixed the issue.

@vaxidovulugbek
Copy link

hi,
DeprecationWarning: The URL http://your-proxy-url:your-proxy-port is invalid. Future versions of Node.js will throw an error.
how to fix this bug ? npm is not worked

@Foddie2
Copy link

Foddie2 commented Mar 7, 2024

This does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests