Skip to content

Commit

Permalink
fix: force npm to use the bundled node-gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jun 25, 2022
1 parent 689b5f1 commit 27ca8dd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/apm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ done

binDir=`pwd -P`

# Force npm to use the bundled node-gyp
# set the path to the node-gyp fallback
export npm_config_node_gyp="$SCRIPT_DIR"/../node_modules/node-gyp/bin/node-gyp.js

cliPath="$binDir/../lib/cli.js"
Expand Down
2 changes: 1 addition & 1 deletion bin/apm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if not defined apm_git_path (
if defined apm_git_path set "Path=!apm_git_path!;!PATH!"
)

:: Force npm to use the bundled node-gyp
:: set the path to the node-gyp fallback
set npm_config_node_gyp="%~dp0\\..\\node_modules\\node-gyp\\bin\\node-gyp.js"
set "npm_config_node_gyp=%npm_config_node_gyp:\=/%"

Expand Down
2 changes: 1 addition & 1 deletion bin/npm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$SCRIPT_DIR:$PATH"

# Force npm to use the bundled node-gyp
# set the path to the node-gyp fallback
export npm_config_node_gyp="$SCRIPT_DIR"/../node_modules/node-gyp/bin/node-gyp.js

"$SCRIPT_DIR"/../node_modules/.bin/npm $@
2 changes: 1 addition & 1 deletion bin/npm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ setlocal EnableDelayedExpansion

set "PATH=%~dp0;%PATH%"

:: Force npm to use the bundled node-gyp
:: set the path to the node-gyp fallback
set npm_config_node_gyp="%~dp0\\..\\node_modules\\node-gyp\\bin\\node-gyp.js"
set "npm_config_node_gyp=%npm_config_node_gyp:\=/%"

Expand Down
2 changes: 1 addition & 1 deletion bin/pnpm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$SCRIPT_DIR:$PATH"

# Force npm to use the bundled node-gyp
# set the path to the node-gyp fallback
export npm_config_node_gyp="$SCRIPT_DIR"/../node_modules/node-gyp/bin/node-gyp.js

"$SCRIPT_DIR"/../node_modules/.bin/pnpm $@
2 changes: 1 addition & 1 deletion bin/pnpm.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ setlocal EnableDelayedExpansion

set "PATH=%~dp0;%PATH%"

:: Force npm to use the bundled node-gyp
:: set the path to the node-gyp fallback
set npm_config_node_gyp="%~dp0\\..\\node_modules\\node-gyp\\bin\\node-gyp.js"
set "npm_config_node_gyp=%npm_config_node_gyp:\=/%"

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,10 @@
"prettier": "^2.7.1",
"prettier-config-atomic": "^3.0.10",
"shx": "^0.3.3"
},
"pnpm": {
"overrides": {
"npm>node-gyp": "^9.0.0"
}
}
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 27ca8dd

Please sign in to comment.