Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork234
feat: add cnpm to corepack#333
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
aduh95 commentedDec 5, 2023
Could it be possible to drop that and download ready-to-be-used code instead? |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
> 修改构建配置,将 cnpm 运行依赖进行 bundle 处理,seenodejs/corepack#3331. 期望 cnpm 能直接集成在 corepack 中作为 nodejs 预置的包管理器2. 目前其他 pnpm、npm 和 yarn 都会做 bundle 处理,cnpm 由于集成了 npm,只能继续使用 bundleDeps的方式打包corepack 通过 tgz 进行分发, 没有时机执行相关依赖安装。尝试过两种方式进行 bundle:1. ❎ 通过 esbuild,无法处理 require.resolve npm 的场景,考虑到依赖稳定性需要将 npm 一并 bundle2. ✅ 通过 bundleDeps 配置两种方式都需要通过 `npm` mode 进行安装目前 bundle 后 tgz 体积为 `8.7M`,和 pnpm,yarn 相比差距较大 (~2M)
Uh oh!
There was an error while loading.Please reload this page.
aduh95 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You probably want to updatesync.yml so the version of cnpm inconfig.json stays up-to-date
229e83f to966b3ecCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
0999d8b to6856b78Compareelrrrrrrr commentedDec 14, 2023
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
anonrig commentedDec 14, 2023
cc @nodejs/security-wg |
legendecas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I confirm that cnpm is a helpful alternative to npm in China where registry.npmjs.org may be hardly reachable for common users.https://registry.npmmirror.com is a mirror of registry.npmjs.org for users based in China to get better access to npm packages.
It would definitely help users get started with Node.js and install npm dependencies in China.
I support adding cnpm and npmmirror.com to corepack.
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
joyeecheung commentedDec 14, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Can't review the code per-se myself, but I can also confirm that cnpm is a trust-worthy alternative primarily sponsored by Alibaba to help Node.js developers in China work around the network issues in the public network in China & create private registries within a company. |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
arcanis commentedDec 15, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not familiar with cnpm, so couple of questions:
|
elrrrrrrr commentedDec 15, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you for your interest and questions about cnpm. I am pleased to provide you with the following clarifications:
Indeed, we offer a complete read-only mirror service capability. Developers can directly configure the registry address and use yarn, pnpm, or any package manager of their choice. However, we still provide an independent client, mainly to handle the following scenarios:
Like all websites accessible within China, cnpm aligns with the country's internet and data regulations. For over 10 years, it has been reliably serving users while adhering to Mainland China's regulatory requirements. This compliance ensures that cnpm's default registry undergoes thorough network filing and security scanning, aligning with local policy standards. Our commitment is to provide reliable and compliant services to developers, not just in China but globally, always mindful of the legal nuances in different regions.
cnpm includes npm to ensure maximum compatibility. In the corporate environment, we also offer some extended capabilities. We continue to advance related open-source work, including:
These features, in addition to changes on the registry side, also require client-side adaptation. Please let me know if you have any further questions or need more information. 🙏🏻 |
aladdin-add commentedFeb 1, 2024
Whether or not to support setting registry tohttps://registry.npmmirror.com/ when not using cnpm? |
| "versions":"versions", | ||
| "tags":"dist-tags" | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We should probably provide mentioned for the npm package, see#339
| } | |
| }, | |
| "npmRegistry": { | |
| "type":"npm", | |
| "package":"cnpm" | |
| }, |
| Npm=`npm`, | ||
| Pnpm=`pnpm`, | ||
| Yarn=`yarn`, | ||
| Cnpm=`cnpm`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nit: ASCII/alphabetical order
| Npm=`npm`, | |
| Pnpm=`pnpm`, | |
| Yarn=`yarn`, | |
| Cnpm=`cnpm`, | |
| Cnpm=`cnpm`, | |
| Npm=`npm`, | |
| Pnpm=`pnpm`, | |
| Yarn=`yarn`, |
zanminkian commentedApr 3, 2025
It seems cnpm is not actively maintaining. The future of cnpm is not very clear. |
Uh oh!
There was an error while loading.Please reload this page.
🪝 Add apost-installhook to install cnpm-related dependencies.Fixes:#331