pnpm/pnpm

PNPM Failes to execute in vscode integrated terminal

Open

#4.774 geöffnet am 20. Mai 2022

Auf GitHub ansehen
 (4 Kommentare) (1 Reaktion) (0 zugewiesene Personen)TypeScript (1.063 Forks)batch import
help wantedtype: bug

Repository-Metriken

Stars
 (30.787 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 2T 7h) (398 gemergte PRs in 30 T)

Beschreibung

pnpm version:

7.1.2

Code to reproduce the issue:

I have a clean install of PNPM, installed using the PowerShell command on the website, and node installed via PNPM env. When i try to run any command via the integrated terminal in vscode it fails with the same error. I am able to run the commands in a normal windows terminal and get it to do the expected behavior. This has happened on two of my windows computers. This issue also happens when i use WSL via vscodes remote WSL extension. However, if I just launch a wsl shell without using the extention, via wsl then it is able to execute normally.

Expected behavior:

PNPM to be able to run in the vscode terminal as it would in the windows terminal.

Actual behavior:

~ via 🐍 v3.9.7                                                                                                      ❯ pnpm.exe                                                                                                           
internal/modules/package_json_reader.js:4
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
                                                                   ^

TypeError: require(...).internalModuleReadJSON is not a function
    at internalModuleReadJSON (internal/modules/package_json_reader.js:4:68)
    at Object.read (internal/modules/package_json_reader.js:21:34)
    at readPackage (internal/modules/cjs/loader.js:251:36)
    at readPackageScope (internal/modules/cjs/loader.js:284:19)
    at trySelf (internal/modules/cjs/loader.js:399:40)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:863:24)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1225:12)
    at loadPreloadMod
❯ pnpm env
internal/modules/package_json_reader.js:4
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
                                                                   ^

TypeError: require(...).internalModuleReadJSON is not a function
    at internalModuleReadJSON (internal/modules/package_json_reader.js:4:68)
    at Object.read (internal/modules/package_json_reader.js:21:34)
    at readPackage (internal/modules/cjs/loader.js:251:36)
    at readPackageScope (internal/modules/cjs/loader.js:284:19)
    at trySelf (internal/modules/cjs/loader.js:399:40)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:863:24)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1225:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:472:5)
❯ pnpm add -g @quasar/cli
internal/modules/package_json_reader.js:4
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
                                                                   ^

TypeError: require(...).internalModuleReadJSON is not a function
    at internalModuleReadJSON (internal/modules/package_json_reader.js:4:68)
    at Object.read (internal/modules/package_json_reader.js:21:34)
    at readPackage (internal/modules/cjs/loader.js:251:36)
    at readPackageScope (internal/modules/cjs/loader.js:284:19)
    at trySelf (internal/modules/cjs/loader.js:399:40)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:863:24)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1225:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:472:5)

thomas@Thomas-HPx360:/mnt/c/Users/devcs/projects/bio_blockchain$ pnpm
internal/modules/package_json_reader.js:4
const internalModuleReadJSON = function (f) { return require('fs').internalModuleReadJSON(f); };
                                                                   ^

TypeError: require(...).internalModuleReadJSON is not a function
    at internalModuleReadJSON (internal/modules/package_json_reader.js:4:68)
    at Object.read (internal/modules/package_json_reader.js:21:34)
    at readPackage (internal/modules/cjs/loader.js:251:36)
    at readPackageScope (internal/modules/cjs/loader.js:284:19)
    at trySelf (internal/modules/cjs/loader.js:399:40)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:863:24)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1225:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:472:5)

Additional information:

  • node -v prints:
~ via 🐍 v3.9.7
❯ pnpm -v
7.1.2

~ via 🐍 v3.9.7
❯ node -v
v16.15.0
  • Two Windows machines in a windows environment and on a remote extension WSL vscode

Contributor Guide