-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spurious ${LOCALAPPDATA} folder created when hovering a dependency name in package.json #211914
Comments
Not sure who to assign this to. I was wondering @joaomoreno if you would know? |
The following script is a stripped down version of the npmView() method in the VSCode's builtin npm extension. import { execFile } from 'node:child_process'
import which from 'which'
const npmCommandPath = await which(process.platform === 'win32' ? 'npm.cmd' : 'npm')
const pack = 'eslint'
const result = await new Promise((resolve, _reject) => {
const args = ['view', '--json', '--', pack, 'description', 'dist-tags.latest', 'homepage', 'version', 'time']
const cwd = process.cwd()
// corepack npm wrapper would automatically update package.json. disable that behavior.
// COREPACK_ENABLE_AUTO_PIN disables the package.json overwrite, and
// COREPACK_ENABLE_PROJECT_SPEC makes the npm view command succeed
// even if packageManager specified a package manager other than npm.
const env = { COREPACK_ENABLE_AUTO_PIN: "0", COREPACK_ENABLE_PROJECT_SPEC: "0" }
execFile(npmCommandPath, args, { cwd, env, shell: true }, (error, stdout) => {
if (!error) {
try {
const content = JSON.parse(stdout)
const version = content['dist-tags.latest'] || content['version']
resolve({
description: content['description'],
version,
time: content.time?.[version],
homepage: content['homepage']
})
return
} catch (e) {
// ignore
}
}
resolve(undefined)
})
}).catch(e => null)
console.log(result) When run from the command line, the script creates the The Not sure where to go from here. One last remark: the |
should be resolved by #213306 |
#213306 fixes the issue |
Type: Bug
package.json
file.package.json
to display the package's details.${LOCALAPPDATA}
appears in the same directory where thepackage.json
file resides.It appears from the logs in that folder that
vscode
launchesnpm view
to get the package details:So I tried the same command from the shell:
npm view --json -- eslint description dist-tags.latest homepage version time
The extra folder was not created.
VS Code version: Code 1.89.0 (b58957e, 2024-05-01T02:09:22.859Z)
OS version: Windows_NT x64 10.0.22631
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
The text was updated successfully, but these errors were encountered: