
Security News
NVD Quietly Sweeps 100K+ CVEs Into a “Deferred” Black Hole
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
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.
The npm package install-nativescript receives a total of 10 weekly downloads. As such, install-nativescript popularity was classified as not popular.
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
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
Research
Security News
Lazarus-linked threat actors expand their npm malware campaign with new RAT loaders, hex obfuscation, and over 5,600 downloads across 11 packages.
Security News
Safari 18.4 adds support for Iterator Helpers and two other TC39 JavaScript features, bringing full cross-browser coverage to key parts of the ECMAScript spec.