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

feat: remove NODE_ENV in npmClient #12462

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/utils/src/npmClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ export const installWithNpmClient = ({
cwd?: string;
}): void => {
const { sync } = require('../compiled/cross-spawn');
// pnpm install will not install devDependencies when NODE_ENV === 'production'
// we should remove NODE_ENV to make sure devDependencies can be installed
const { NODE_ENV: _, ...env } = process.env;
const { ...env } = process.env;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

考虑到移除NODE_ENV可能对开发环境中的包安装产生影响,建议详细测试这一更改。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从 pnpm 哪个版本开始变化的,是不是得加个版本判断?

const npm = sync(npmClient, [npmClient === 'yarn' ? '' : 'install'], {
stdio: 'inherit',
cwd,
Expand Down
Loading