Disable fetching package information from NPM and Bower in Visual Studio Code
- Linux onlyThis script improves your privacy on Linux
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Impact: High
System Functionality / Data Loss Risk: High
This action improves privacy with high impact when you run the recommended script.
- Bash (Shell script)These changes use Linux system commands to update your settings.
- Sudo/root requiredThis script requires privilege access to do the system changes
- Fully reversible
You can fully restore this action (revert back to the original behavior) using this website.
The restore/revert methods provided here can help you fix issues.
Overview
Visual Studio Code fetches data from NPM and Bower to provide autocompletion and hover information
for npm dependencies 1. By default, this feature is enabled 2 and fetches data from
https://registry.npmjs.org
and https://registry.bower.io
1.
This script prevents the automatic fetching of package information.
You can disable this feature by setting npm.fetchOnlinePackageInfo
to false
2.
This script should only be used by advanced users.
This script is not recommended for daily use as it breaks important functionality.
Consider creating a system backup before doing any changes.
Sources
- vscode/package.nls.json at 21504708043941c1e9e45b7d0892a9a8a03470d7 · microsoft/vscode · GitHub. github.com. (2022).
Original: https://github.com/microsoft/vscode/blob/21504708043941c1e9e45b7d0892a9a8a03470d7/extensions/npm/package.nls.json
Archived: https://web.archive.org/web/20221029172113/https://github.com/microsoft/vscode/blob/21504708043941c1e9e45b7d0892a9a8a03470d7/extensions/npm/package.nls.json#L17 - vscode/package.json at 29e985eca0713c8458ae8349c1742d6fb75719e4 · microsoft/vscode · GitHub. github.com. (2022).
Original: https://github.com/microsoft/vscode/blob/29e985eca0713c8458ae8349c1742d6fb75719e4/extensions/npm/package.json
Archived: https://web.archive.org/web/20221029172220/https://github.com/microsoft/vscode/blob/29e985eca0713c8458ae8349c1742d6fb75719e4/extensions/npm/package.json#L293-L300
Apply Now
Choose one of three ways to apply:
Help
How to apply or restore "Disable fetching package information from NPM and Bower in Visual Studio Code" using script
- ≈ 3 min to complete
- Tools: Web Browser
- Difficulty: Medium
- ≈ 5 instructions
- 1
Download
Download the script file by clicking on thebutton above.
Use button above to restore changes. - 2
Keep the file
If warned by your browser, keep the file. - 3
Open
Open the downloaded file. - 4
Exit
Once it's done, press any key to exit the window. - 5
Restart
Restart your computer for all changes to take effect.
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
Help
How to apply or restore "Disable fetching package information from NPM and Bower in Visual Studio Code" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2
Choose script
- Search for the script name: Disable fetching package information from NPM and Bower in Visual Studio Code
- Check the script by clicking on the checkbox.
- 3
Run
Click on ▶️ Run button at the bottom of the page.This button only appears on desktop version (recommended). On browser, use 💾 Save button.
- Apply
- Revert
if ! command -v 'python3' &> /dev/null; then
echo 'Skipping because "python3" is not found.'
else
python3 <<EOF
from pathlib import Path
import os, json, sys
property_name = 'npm.fetchOnlinePackageInfo'
target = json.loads('false')
home_dir = f'/home/{os.getenv("SUDO_USER", os.getenv("USER"))}'
settings_files = [
# Global installation (also Snap that installs with "--classic" flag)
f'{home_dir}/.config/Code/User/settings.json',
# Flatpak installation
f'{home_dir}/.var/app/com.visualstudio.code/config/Code/User/settings.json'
]
for settings_file in settings_files:
file=Path(settings_file)
if not file.is_file():
print(f'Skipping, file does not exist at "{settings_file}".')
continue
print(f'Reading file at "{settings_file}".')
file_content = file.read_text()
if not file_content.strip():
print('Settings file is empty. Treating it as default empty JSON object.')
file_content = '{}'
json_object = None
try:
json_object = json.loads(file_content)
except json.JSONDecodeError:
print(f'Error, invalid JSON format in the settings file: "{settings_file}".', file=sys.stderr)
continue
if property_name not in json_object:
print(f'Settings "{property_name}" is not configured.')
else:
existing_value = json_object[property_name]
if existing_value == target:
print(f'Skipping, "{property_name}" is already configured as {json.dumps(target)}.')
continue
print(f'Setting "{property_name}" has unexpected value {json.dumps(existing_value)} that will be changed.')
json_object[property_name] = target
new_content = json.dumps(json_object, indent=2)
file.write_text(new_content)
print(f'Successfully configured "{property_name}" to {json.dumps(target)}.')
EOF
fi
ImlmICEgY29tbWFuZCAtdiAncHl0aG9uMycgJj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lcnRlZCBcIntwcm9wZXJ0eV9uYW1lfVwiIHNldHRpbmcuJylcbkVPRlxuICBmaSI=
Help
How to apply or restore "Disable fetching package information from NPM and Bower in Visual Studio Code" using commands
- ≈ 2 min to complete
- Tools: Terminal
- Difficulty: Medium
- ≈ 3 instructions
- 1
Open terminal
Open your terminal application. - 2
Copy code
Copy the code: - 3
Paste & run
Paste the commands into terminal application and press Enter to run.Some changes require a system restart to take effect
Similar Guides
Wider Goal
Guides below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.
These plans combine multiple privacy settings, including this one, for stronger protection.
- Disable Visual Studio Code data collection
- Configure programs
Visual Studio Code, also commonly referred to as VS Code, is a source-code editor made by Microsoft. Visual Studio Code makes outgoing network requests to collect ...
These scripts configure third-party applications installed on Linux distributions to harden their security and privacy to protect your data. They scripts differ fr...
Same Goal
Other guides in Disable Visual Studio Code data collectionSee settings that are in the same category as this guide.
Using other actions in the same category may help you achieve your goal better.
See all 10 guides
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:Expert review by undergroundwires
- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
Public review by large community
- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
History
We continually monitor our guides, their impact and all other privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.