Closed admmasters closed 4 years ago
Note this only occurs with a locally installed typescript - seems whatever new behaviour has been introduced relies upon a globally installed typescript which is not great practice at all.
Confirm the issue on Linux as well (Kubuntu 18.04). vsc does not finds tsc command if node is per-user nvm-installed.
R
Here's the logic we use to look up the tsc path: https://github.com/microsoft/vscode/blob/cf197953d7c65b4131147d93cf0dc7766a610b70/extensions/typescript-language-features/src/features/task.ts#L183
Note that is prefers using the local tsc installed under node_modules
. How do you have tsc installed?
Hi @mjbvz
How do you have tsc installed?
I have tried with both.
> Executing task: /home/robi/src2/industry40/node_modules/.bin/tsc -p /home/robi/src2/industry40/tsconfig.json --watch < /usr/bin/env: ‘node’: No such file or directory The terminal process terminated with exit code: 127
It seems that newer versions of VSC don't read .bashrc before opening the internal terminal or it's read async.
If I open an integrated terminal and type the "tsc -p ... --watch" command line myself, the compiler executes.
Node Version: 13.2.0 TS Version: 3.8.0-dev.20191128
R
VS Code tasks have never read the .bashrc. By default, tasks run "terminal.integrated.inheritEnv": false
set? That would cause this behavior.
Do you have "terminal.integrated.inheritEnv": false set? That would cause this behavior.
It is set to true.
Can you share your tasks.json if you have one and all of your settings.json files?
Can you share your tasks.json if you have one and all of your settings.json files?
@alexr00 Yes. I'll have to edit out some info for security and non-disclosure reasons.
The key point I think is the error line reported in the internal terminal when opened with ^B:
/usr/bin/env: ‘node’: No such file or directory
If I open a new internal terminal ("+") and issue:
tsc -p tsconfig.json
or
tsc -p tsconfig.json --watch
tsc executes.
R
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
]
}
]
}
tsconfig.json:
{
"compilerOptions": {
"incremental": true,
"target": "es5",
"module": "amd",
"lib": [
"es6",
"dom",
"es2015.iterable"
],
"allowJs": true,
"sourceMap": true,
"outFile": <cut>,
"outDir": <cut>
"strict": true,
"esModuleInterop": true ,
"inlineSourceMap": false,
"inlineSources": false,
},
"files": [
<cut>
],
"include": [
<cut>
],
"exclude": [
<cut>
]
}
The other key thing to note here is that this is 100% working on the normal channel so whatever change in behaviour has been introduced is recent and unique to the insiders channel.
Can you share your settings.json?
{
"cSpell.words": [
"persistor"
],
"typescript.tsdk": "node_modules/typescript/lib"
}
{
"npm.packageManager": "yarn",
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"editor.tabSize": 2,
"editor.renderWhitespace": "all",
"javascript.updateImportsOnFileMove.enabled": "always",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"workbench.iconTheme": "material-icon-theme",
"editor.formatOnSave": true,
"editor.fontFamily": "Source Code Pro for Powerline",
"workbench.colorTheme": "Winter is Coming (Dark Blue - No Italics)",
"editor.suggestSelection": "first",
"sync.gist": "5f44767f3b5aaa317b0ea5151cae465d",
"go.useLanguageServer": true,
"typescript.preferences.quoteStyle": "single",
"typescript.preferences.importModuleSpecifier": "relative",
"eslint.alwaysShowStatus": true,
"eslint.autoFixOnSave": true,
"eslint.packageManager": "yarn",
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"window.zoomLevel": 0,
"terminal.integrated.inheritEnv": true
}
Had this same issue popping up after updating vscode to version 1.41.0
, while it has been working perfectly fine until then.
Running on macOS Catalina version 10.15.2
.
he other key thing to note here is that this is 100% working on the normal channel
On Linux the same issue is present in 1.40.02 stable.
Same behavior Version: 1.41.0 was working fine yesterday.
Same behavior Version: 1.41.0 was working fine yesterday.
Had to downgrade it: https://code.visualstudio.com/updates/v1_40 to solve it.
Can anyone who's seeing this share the full terminal output from the task?
Found the issue: cf197953d7c65b4131147d93cf0dc7766a610b70
On linux (and maybe others, just not Windows). the stat.type
of the node_modules/.bin/tsc
is 65, which isn't vscode.FileType.File
(that's actually `).
The FileStat#type
property is a bitmask, so 65 is a sym-link to a file (1 /file/ + 64 /symlink/)
Yup, today's the first time I've ever looked at our FileStat
API so I read the documentation :)
Can anyone who's seeing this share the full terminal output from the task?
@alexr00 what do you need exactly? The error I get is the same as the one @RobertoMalatesta posted already here: https://github.com/microsoft/vscode/issues/85753#issuecomment-560177248.
Discussed in our standup and agreed to be included for November Recovery.
Can confirm this is again working for me with vscode version 1.41.1
.
1.41.1 : same problem persists:
... same happens with latest insider.
A temporary remedy is to create a link that env can see. in my case: ln -s /home/robi/.nvm/versions/node/v13.2.0/bin/node /usr/local/bin/node But it's an ugly patch and I hate ugliness.
Merry X-Mas, --R
Having a similar issue.
Here I tried to run make
as a task:
Here I tried to run make
in a different integrated terminal session:
And the operation was successful. It was able to find the path and run.
It seems like when I run a task the new terminal session is stripped out of any user configurations and starts running a factory version of the terminal.
VSCode: 1.41.1 macOS 10.14.6
c_cpp_properties.json
{
"configurations": [
{
"name": "ESP-IDF",
"includePath": [
"${workspaceRoot}/main/**",
"${workspaceRoot}/build/include/",
"${env:IDF_PATH}/components/**"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"
],
"compilerPath": "~/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
settings.json
{
"C_Cpp.updateChannel": "Insiders",
"workbench.editor.highlightModifiedTabs": true,
"editor.acceptSuggestionOnEnter": "off",
"files.trimFinalNewlines": true,
"terminal.integrated.env.osx":
{
"PATH": "$HOME/esp/xtensa-esp32-elf/bin:$PATH"
}
}
Please open a new issue since this isn't a problem with typescript task detection.
done. https://github.com/microsoft/vscode/issues/88290
Thank you @alexr00
I'm noting this behaviour as it has occurred in the insiders build for a few releases now.
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes