
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
install-nativescript
Advanced tools
Package that helps you install Node.js, npm and nativescript-cli. Works only on Windows and Mac.
Package that helps you install Node.js, npm and nativescript-cli from within an Electron app. Works only on Windows and Mac.
npm install --save install-nativescript
const installNativeScript = require("install-nativescript");
installNativeScript.ensureNode()
.then(() => {
return installNativeScript.ensureCLI();
})
The ensureNode
method checks if node is installed on the machine. In case it cannot detect it, the method downloads a node installer and runs it. You can pass a specific node version to install. In case it is not provided, the method installs version 10.15.3.
Note: This method changes process.env so that after it succeeds, you can install and detect globally installed npm modules.
Usage:
const installNativeScript = require("install-nativescript");
installNativeScript.ensureNode();
The ensureCLI
method checks if you have NativeScript CLI installed globally on your machine.
Usage:
const installNativeScript = require("install-nativescript");
installNativeScript.ensureCLI();
One of the reasons why ensureCLI
method may fail on Mac machines, is in case some npm folders require root access. This method can help you detect this case. Just pass the error from ensureCLI
and it will return an array of folders that might require root access. In case the array is empty, the error is not related to missing permissions.
Usage:
const installNativeScript = require("install-nativescript");
installNativeScript.ensureCLI()
.catch((error) => {
const permissionsFolders = installNativeScript.getNPMFoldersWithMissingPermissions(error);
});
The fixMissingNPMPermissions
method accepts an array of folders and tries to change their permissions.
Usage:
const installNativeScript = require("install-nativescript");
installNativeScript.ensureCLI()
.catch((error) => {
const permissionsFolders = installNativeScript.getNPMFoldersWithMissingPermissions(error);
if (permissionsFolders.length === 0) {
return Promise.reject(error);
}
// It is a good idea to ask the user at this point if they approve the change and then change the permissions.
return installNativeScript.fixMissingNPMPermissions(permissionsFolders)
.then(() => {
return installNativeScript.ensureCLI();
});
});
FAQs
Package that helps you install Node.js, npm and nativescript-cli. Works only on Windows and Mac.
We found that install-nativescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.