Skip to content

Commit

Permalink
Merge pull request #5689 from wordpress-mobile/jetpack-install-deps-d…
Browse files Browse the repository at this point in the history
…isable-engine-strict

Disable `npm` configuration parameter `engine-strict` when installing dependencies of Jetpack
  • Loading branch information
fluiddot committed Apr 20, 2023
2 parents 7a7f64d + 64a4951 commit e53664c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion bin/install-jetpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,23 @@ nvm install
listed_pnpm_version=$(npx -c 'echo $npm_package_engines_pnpm')
pnpm_version=$(npx semver -c "$listed_pnpm_version")

cd projects/plugins/jetpack
# Disable `engine-strict` parameter
#
# The `node` version required by Jetpack will be used to install the dependencies. However, we can't
# ensure that the `node` version used by `npm` to check the `engines` parameter is the expected one.
# More information in: https://github.com/wordpress-mobile/gutenberg-mobile/issues/5688
sed -i.bak 's/^engine-strict = true/engine-strict = false/' .npmrc

# Install dependecies of Jetpack plugin
pushd projects/plugins/jetpack

# npx might prompt to install pnpm at the requested version. Let's just agree and carry on.
( yes || true ) | npx --cache /tmp/empty-cache pnpm@"$pnpm_version" install --ignore-scripts

popd

# Revert `engine-strict` parameter back
sed -i.bak 's/^engine-strict = false/engine-strict = true/' .npmrc
rm .npmrc.bak

popd

0 comments on commit e53664c

Please sign in to comment.