
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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 8 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.