rewrap-vitejs-tailwind
Version:
Installer for Vite + TailwindCSS
19 lines (16 loc) • 644 B
JavaScript
const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");
const npmCachePath = execSync("npm config get cache").toString().trim();
const testPath = path.join(npmCachePath, "_test_write");
try {
fs.writeFileSync(testPath, "test");
fs.unlinkSync(testPath);
} catch (err) {
console.error("\n🚨 Permission Issue Detected! 🚨");
console.error("Your npm cache folder has incorrect permissions.");
console.error("To fix this, run the following command:");
console.log("\n sudo chown -R $(whoami) ~/.npm\n");
console.error("Then retry installing the package.\n");
process.exit(1);
}