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

fix: avoid require bug in node.js 13.0 #209

Closed
wants to merge 1 commit into from

Conversation

bluelovers
Copy link

@bluelovers bluelovers commented Apr 12, 2020

nodejs/modules#446

"Error: Package exports for '/data/data/com.termux/files/home/.config/yarn/global/node_modules/nanoid' do not define a valid '.' target\n"

Screenshot_20200412-121017_Termux

nodejs/modules#446

    "Error: Package exports for '/data/data/com.termux/files/home/.config/yarn/global/node_modules/nanoid' do not define a valid '.' target\n"
@ai
Copy link
Owner

ai commented Apr 12, 2020

@bluelovers dual-publish automatically inserts main to package.json during the publish.

How I can reproduce your issue?

@bluelovers
Copy link
Author

bluelovers commented Apr 12, 2020

this pr is failed, it can't fix this issue

but if i edit inretface-datastore/src/key.js

replace nanoid to nanoid/index will not have this error at start up
but i can't replace it at every where


install termux on android phone
install git and nodejs , yarn
nodejs will be 13.0.0 <== new version didn't have this issue, but termux only have this version

yarn global add novel-opds-now
novel-opds-now

don't use npm install this
will see this error


i also try request termux update nodejs too, but not sure they will see my email xd

@ai
Copy link
Owner

ai commented Apr 12, 2020

It happens because Node.js 13 does not support conditional exports. Look at node_modules/nanoid/package.json.

You can enable it manually by running node --experimental-conditional-exports.

@ai ai closed this Apr 12, 2020
@TrySound
Copy link

@ai But it does support. Just emits warning.

@ai
Copy link
Owner

ai commented Apr 12, 2020

@TrySound there were some bugs in old Node.js 13.0 versions.

I think we should support only the latest version of each Node.js 10.x, 12.x, and 13.x branches.

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

Successfully merging this pull request may close these issues.

3 participants