Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.