Skip to content

Commit

Permalink
chore: Remove npm version pinning and use global npm for alias instal…
Browse files Browse the repository at this point in the history
…lation (#14)

* chore: pin npm@10

* chore: removed redundant npm install in install_requirements_npm_aliases

* chore: Use global npm for alias installation in install_requirements_npm_aliases

* chore: removed unnecessary comment
  • Loading branch information
BilalQamar95 authored Aug 29, 2024
1 parent ab41ab5 commit 13414ad
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tubular/scripts/frontend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,9 @@ def install_requirements_npm_aliases(self):
""" Install NPM alias requirements for app to build """
npm_aliases = self.get_npm_aliases_config()
if npm_aliases:
# Install and pin NPM to latest npm@8 version
proc = subprocess.Popen(['npm install npm@8'], cwd=self.app_name, shell=True)
return_code = proc.wait()
if return_code != 0:
self.FAIL(1, 'Could not run `npm install npm@8` for app {}.'.format(self.app_name))

aliased_installs = ' '.join(['{}@{}'.format(k, v) for k, v in npm_aliases.items()])
# Use the locally installed npm at ./node_modules/.bin/npm
install_aliases_proc = subprocess.Popen(
['./node_modules/.bin/npm install {}'.format(aliased_installs)],
['npm install {}'.format(aliased_installs)],
cwd=self.app_name,
shell=True
)
Expand Down

0 comments on commit 13414ad

Please sign in to comment.