You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Request for NPM to validate packages before publish.
Especially for ESM, since: Node.js is chocking on npm packages having invalid ESM.
The validation doesn't have to cover everything. Only validating basics things like the following would make a big impact already:
a widespread problem is npm packages having invalid ESM imports, e.g. import './foo' instead of import './foo.js', which makes Node.js choke. Another example is packages that ship ESM but don't have type: "module" in their package.json. Node.js should be able to execute npm packages that ship invalid code.
You can write invalid CJS packages as well. And we see that happen constantly. E.g. "type": "module" and CJS code with .js extension - the CJS code won't run on Node. Node packaging has gotten more complicated since the introduction of exports, .cjs/.mjs, etc. and we see packages published to npm that won't run on Node on a non-stop basis.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Request for NPM to validate packages before publish.
Especially for ESM, since: Node.js is chocking on npm packages having invalid ESM.
npm/rfcs#665 (comment)
But also for CJS:
npm/rfcs#665 (comment)
See @brillout's original request, for details and initial discussion: npm/rfcs#665
Reposting it here due to notice that this might be the more appropriate place.
Beta Was this translation helpful? Give feedback.
All reactions