added task to uninstall before installing new version - allows change…#14
Open
fubarhouse wants to merge 1 commit intonodesource:masterfrom
fubarhouse:master
Open
added task to uninstall before installing new version - allows change…#14fubarhouse wants to merge 1 commit intonodesource:masterfrom fubarhouse:master
fubarhouse wants to merge 1 commit intonodesource:masterfrom
fubarhouse:master
Conversation
… of version on reprovisioning scripts
kitsunde
reviewed
Sep 30, 2016
|
|
||
| - name: Uninstall existing installations of Node.js | ||
| apt: name=nodejs state=absent | ||
|
|
There was a problem hiding this comment.
Is there some way of making this check it is necessary? It would be way too excessive to have node reinstall itself every time we run through ansible.
Author
There was a problem hiding this comment.
Since posting this issue I've created my own Ansible implementation of NVM and I no longer use nodesource.
If you were to do so, you should check for an existing install, register a variable with the currently installed version and provide some logic to determine if it should be uninstalled first.
zaheerquodroid
added a commit
to QuoDroid-Default/multi-cloud-deployer
that referenced
this pull request
Mar 11, 2026
2026 best practice: Remove existing Node.js before upgrading versions. Problem: - Ubuntu 22.04 ships with Node.js v12.22.9 from default repositories - apt with state: present won't upgrade already-installed packages - NodeSource repository was added but old version remained Solution: - Remove old nodejs and npm packages with purge and autoremove - Then install Node.js 20 from NodeSource repository - This ensures clean upgrade from v12 to v20 References: - NodeSource upgrade guide: https://nodesource.com/blog/Update-Node.js-versions-on-linux - Ansible best practice: nodesource/ansible-nodejs-role#14 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow function to change versions of Node.js if the nodejs version variable changes to allow seamless porting between the available versions.
Tested with DrupalVM on provision, and reprovision between both versions, and has no effect when install hasn't been previously executed from the playbook.