Skip to content
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

VSCode terminal process command failed to launch #107895

Closed
evestorm opened this issue Oct 1, 2020 · 5 comments
Closed

VSCode terminal process command failed to launch #107895

evestorm opened this issue Oct 1, 2020 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@evestorm
Copy link

evestorm commented Oct 1, 2020

  • VSCode Version: 1.49.2
  • OS Version: 10.15.7
  • node Version: 12.18.4
  • npm Version: 6.14.6
  • tsc Version: 4.0.3

Steps to Reproduce:

Terminal ➡️ Run task ➡️ 「tsc: watch - tsconfig.json」

> Executing task: tsc -p '/Users/macbook/Documents/demo/tsconfig.json' --watch <

env: node: No such file or directory
The terminal process "/bin/bash '-c', 'tsc -p '/Users/macbook/demo/tsconfig.json' --watch'" failed to launch (exit code: 127).

Terminal will be reused by tasks, press any key to close it.

Tree:

.
├── index.ts
├── js/
└── tsconfig.json

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "outDir": "./js",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}

Hope someone can help me 😢

@alexr00
Copy link
Member

alexr00 commented Oct 2, 2020

Does the same command work if you run it in the integrated terminal (tsc -p '/Users/macbook/demo/tsconfig.json' --watch) ?

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Oct 2, 2020
@evestorm
Copy link
Author

evestorm commented Oct 2, 2020

Yes, the command works in terminal.

@alexr00
Copy link
Member

alexr00 commented Oct 2, 2020

Can you share your tasks.json and your settings.json?

@evestorm
Copy link
Author

evestorm commented Oct 2, 2020

tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "typescript",
			"tsconfig": "tsconfig.json",
			"option": "watch",
			"problemMatcher": [
				"$tsc-watch"
			],
			"group": "build",
			"label": "tsc: watch - tsconfig.json"
		},
		{
			"type": "typescript",
			"tsconfig": "tsconfig.json",
			"problemMatcher": [
				"$tsc"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"label": "tsc: build- tsconfig.json"
		}
	]
}

settings.json

{
    "editor.fontSize": 18,
    "editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
    "emmet.triggerExpansionOnTab": true,
    "emmet.syntaxProfiles": {
        "JavaScript React": "jsx"
    },
    "easysass.formats": [{
            "format": "expanded",
            "extension": ".css"
        },
        {
            "format": "compressed",
            "extension": ".min.css"
        }
    ],
    "easysass.targetDir": "",
    "window.zoomLevel": -1,
    "editor.formatOnPaste": true,
    "javascript.validate.enable": true,
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "sync.gist": "token",
    "sync.lastUpload": "2018-07-25T02:00:11.949Z",
    "sync.autoDownload": false,
    "sync.autoUpload": false,
    "sync.lastDownload": "",
    "sync.forceDownload": false,
    "sync.host": "",
    "sync.pathPrefix": "",
    "sync.quietSync": false,
    "sync.askGistName": false,
    "sync.removeExtensions": true,
    "sync.syncExtensions": true,
    "editor.fontLigatures": true,
    "workbench.statusBar.feedback.visible": false,
    "materialTheme.fixIconsRunning": false,
    "workbench.iconTheme": "vscode-icons",
    "editor.snippetSuggestions": "top",
    "[php]": {

    },
    "[json]": {},
    "php-docblocker.extra": [],
    "files.associations": {
        "*.vue": "vue",
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "liveServer.settings.donotShowInfoMsg": true,
    "php.suggest.basic": false,
    "workbench.activityBar.visible": true,
    "liveServer.settings.donotVerifyTags": true,
    "liveServer.settings.port": 5502,
    "update.mode": "manual",
    "vsicons.dontShowNewVersionMessage": true,
    "[markdown]": {},
    "editor.tabCompletion": "on",
    "editor.tabSize": 3,
    "workbench.colorTheme": "Electron vue",
    "javascript.updateImportsOnFileMove.enabled": "always",
    "typescript.updateImportsOnFileMove.enabled": "always",
    "update.enableWindowsBackgroundUpdates": false,
    "files.trimTrailingWhitespace": true,
    "markdown-preview-enhanced.enableScriptExecution": true,
    "prettier.arrowParens": "always",
    "prettier.semi": true,
    "[python]": {
        "editor.defaultFormatter": "ms-python.python"

    },
    "python.formatting.provider": "yapf",
    "terminal.integrated.inheritEnv": false,
    "python.formatting.blackPath": "yapf",
    "[vue]": {
        "editor.defaultFormatter": "octref.vetur"
    },
    "[jsonc]": {
        "editor.defaultFormatter": "vscode.json-language-features"
    },
    "[html]": {
        "editor.defaultFormatter": "HookyQR.beautify"
    },
    "prettier.useTabs": true,
    "prettier.tabWidth": 3,
    "vetur.format.options.tabSize": 3,
    "hediet.vscode-drawio.local-storage": "token",
    "terminal.integrated.shell.osx": "/bin/bash",
    "editor.renameOnType": true
}

@alexr00
Copy link
Member

alexr00 commented Oct 2, 2020

Looks like this is the culprit: "terminal.integrated.inheritEnv": false,. If you set it to true then your issue will be resolved.

The same command works in the regular integrated terminal because that is an interactive and login shell. Tasks is not interactive, and not login which means that your bashrc and profile are not loaded.

@alexr00 alexr00 closed this as completed Oct 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants