@pnpm/worker
Advanced tools
Comparing version 1000.0.1 to 1000.0.2
@@ -21,2 +21,5 @@ "use strict"; | ||
const error_1 = require("@pnpm/error"); | ||
const child_process_1 = require("child_process"); | ||
const is_windows_1 = __importDefault(require("is-windows")); | ||
const shell_quote_1 = require("shell-quote"); | ||
let workerPool; | ||
@@ -182,3 +185,4 @@ async function restartWorkerPool() { | ||
if (status === 'error') { | ||
reject(new error_1.PnpmError(error.code ?? 'SYMLINK_FAILED', error.message)); | ||
const hint = opts.deps?.[0]?.modules != null ? createErrorHint(error, opts.deps[0].modules) : undefined; | ||
reject(new error_1.PnpmError(error.code ?? 'SYMLINK_FAILED', error.message, { hint })); | ||
return; | ||
@@ -194,2 +198,24 @@ } | ||
} | ||
function createErrorHint(err, checkedDir) { | ||
if ('code' in err && err.code === 'EISDIR' && (0, is_windows_1.default)()) { | ||
const checkedDrive = `${checkedDir.split(':')[0]}:`; | ||
if (isDriveExFat(checkedDrive)) { | ||
return `The "${checkedDrive}" drive is exFAT, which does not support symlinks. This will cause installation to fail. You can set the node-linker to "hoisted" to avoid this issue.`; | ||
} | ||
} | ||
return undefined; | ||
} | ||
// In Windows system exFAT drive, symlink will result in error. | ||
function isDriveExFat(drive) { | ||
try { | ||
// cspell:disable-next-line | ||
const output = (0, child_process_1.execSync)(`wmic logicaldisk where ${(0, shell_quote_1.quote)([`DeviceID='${drive}'`])} get FileSystem`).toString(); | ||
const lines = output.trim().split('\n'); | ||
const name = lines.length > 1 ? lines[1].trim() : ''; | ||
return name === 'exFAT'; | ||
} | ||
catch { | ||
return false; | ||
} | ||
} | ||
async function hardLinkDir(src, destDirs) { | ||
@@ -196,0 +222,0 @@ if (!workerPool) { |
{ | ||
"name": "@pnpm/worker", | ||
"version": "1000.0.1", | ||
"version": "1000.0.2", | ||
"description": "A worker for extracting package taralls to the store", | ||
@@ -30,17 +30,21 @@ "main": "lib/index.js", | ||
"@rushstack/worker-pool": "0.4.9", | ||
"is-windows": "^1.0.2", | ||
"load-json-file": "^6.2.0", | ||
"shell-quote": "^1.8.2", | ||
"@pnpm/cafs-types": "1000.0.0", | ||
"@pnpm/create-cafs-store": "1000.0.1", | ||
"@pnpm/create-cafs-store": "1000.0.2", | ||
"@pnpm/crypto.polyfill": "1000.0.0", | ||
"@pnpm/exec.pkg-requires-build": "1000.0.0", | ||
"@pnpm/error": "1000.0.1", | ||
"@pnpm/exec.pkg-requires-build": "1000.0.0", | ||
"@pnpm/crypto.polyfill": "1000.0.0", | ||
"@pnpm/graceful-fs": "1000.0.0", | ||
"@pnpm/fs.hard-link-dir": "1000.0.0", | ||
"@pnpm/symlink-dependency": "1000.0.1", | ||
"@pnpm/store.cafs": "1000.0.1", | ||
"@pnpm/fs.hard-link-dir": "1000.0.0", | ||
"@pnpm/symlink-dependency": "1000.0.0" | ||
"@pnpm/graceful-fs": "1000.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/is-windows": "^1.0.2", | ||
"@types/shell-quote": "^1.7.5", | ||
"@pnpm/logger": "1000.0.0", | ||
"@pnpm/types": "1000.0.0", | ||
"@pnpm/worker": "1000.0.1" | ||
"@pnpm/worker": "1000.0.2" | ||
}, | ||
@@ -47,0 +51,0 @@ "funding": "https://opencollective.com/pnpm", |
Sorry, the diff of this file is not supported yet
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
46855
679
14
5
1
+ Addedis-windows@^1.0.2
+ Addedshell-quote@^1.8.2
+ Added@pnpm/core-loggers@1000.1.0(transitive)
+ Added@pnpm/create-cafs-store@1000.0.2(transitive)
+ Added@pnpm/fs.indexed-pkg-importer@1000.0.2(transitive)
+ Added@pnpm/symlink-dependency@1000.0.1(transitive)
+ Addedshell-quote@1.8.2(transitive)
- Removed@pnpm/core-loggers@1000.0.0(transitive)
- Removed@pnpm/create-cafs-store@1000.0.1(transitive)
- Removed@pnpm/fs.indexed-pkg-importer@1000.0.1(transitive)
- Removed@pnpm/symlink-dependency@1000.0.0(transitive)