Comments (9)
I resolved this same issue with TypeScript 5.5.x by upgrading yarn 4.3.0 to 4.4.0.
yarn set version stable
to upgrade yarnyarn install
to update configyarn dlx @yarnpkg/sdks vscode
to reinstall TypeScript SDK
Then reload VSCode with >Developer: Reload Window
.
from berry.
Yarn should work correctly since you are updating dependencies/running tasks from shell. It gets finicky when changes are being detected in VSCode (e.g. reinstalling eslint, stylelint, or any other linter and compiler tools) This is more a issue with the IDE extensions or language server. Another thing to make sure is if VSCode is using the correct Typescript. It should be using the Workspace TS SDK and due to security reasons, if your not prompted by a choice when opening project then you'll have to select it manually so it gets saved, hence the enablePromptUseWorkspaceTsdk: true
in settings.json
, unrelated to tsdk
...
from berry.
Yarn should work correctly since you are updating dependencies/running tasks from shell. It gets finicky when changes are being detected in VSCode (e.g. reinstalling eslint, stylelint, or any other linter and compiler tools) This is more a issue with the IDE extensions or language server. Another thing to make sure is if VSCode is using the correct Typescript. It should be using the Workspace TS SDK and due to security reasons, if your not prompted by a choice when opening project then you'll have to select it manually so it gets saved, hence the
enablePromptUseWorkspaceTsdk: true
insettings.json
, unrelated totsdk
...
I have indicated in the OP to make sure that the correct typescript is being used. I've also purposely not installed anything beyond the minimum to get @yarnpkg/sdks working for typescript. I've also indicated reloading the window to get a clean startup. It's my understanding that the typescript language server uses the tsserver.js that's in the repo (installed by the SDK), and the typescript that's installed locally, which is patched.
Now, seeing as how everything works as intended when node-modules linking is enabled, and only breaks once pnp is enabled (reliably I might add) This leads to me to believe the issue is probably not the language server. Instead, it narrows it down to arcanis.vscode-zipfs
, the typescript patch (yarn), or the typescript vscode SDK (also yarn).
I'd appreciate it if another soul could reproduce this. I posted both the repro repo and step-by-step instructions in the OP.
from berry.
I just downgraded to typescript 5.4.5 and works with [email protected]
| yarn | typescript | works |
| 3.8.3 | 5.5.3 | yes |
| 4.3.1 | 5.4.5 | yes |
| 4.3.1 | 5.5.3 | no |
from berry.
Actually, I just updated to vscode 1.91.1, which also updates the language server. everything seems to be working now. (June update)
from berry.
BTW, noticed that npm is installed on home drive, which on a different path than your node and yarn. Are you using nvm install
to setup node? Before you start VSCode, make sure VSCode is using the correct node in your path.
If switching between node versions, you'll need to reinstall project dependencies again.
from berry.
Good eye. yes, i used nvm. There are multiple versions of node installed, but they're all here: ~/.nvm/versions/node/
just the normal location for nvm. But the reason that you're seeing yarn inside of /tmp
is because that's what it does when corepack is enabled. yarn no longer needs to be installed globally, corepack resolves, downloads, and extracts it for you. So that's all normal.
But vscode on startup looks for node, and gives you a nice/ugly error when it can't find it. I didn't encounter it. I don't see how it could find the wrong version since it must be the same version invoked when I do it from the cli.
from berry.
Maybe I'm on OSX, I find it strange that binaries are not extracted to same folder as npm and node as well e.g. .nvm/versions/node/v20.15.0/bin/yarn
- at least that is consistent with nvm installs on my end. I think possibly nvm
already ships with yarn
. Installing binaries in /tmp
is not in good practice for stable environments, if that is expected outside of npx
or yarn dlx
.
from berry.
corepack ships with node as of version 16.10.0, but it's disabled by default. As of version 18.0.0 it's enabled by default. corepack looks at your package.json for "packageManager" and uses that to determine which package manager to use. Alternatively, if you just invoke yarn
without having first installed it globally, it downloads it for you. So it may as well be installed.
from berry.
Related Issues (20)
- [Feature] run `yarn install` after `yarn patch-commit -s ..`
- [Bug]: yarn -C ignores package.json packageManager setting.
- [Bug?]: wrong peer dependencies reporting HOT 1
- [Bug?]: yarn npm audit IDs are not stable
- [Feature]: use terminal colors HOT 2
- [Bug?]: yarn with node-linker does not correctly install nested dependencies HOT 2
- [Feature] Alternative to Node.js experimental corepack to manage package manager version HOT 4
- [Bug?]: TimeoutOverflowWarning when running PnP project with mocked `Date.now()`
- [Feature] yarn install --yes HOT 1
- [Bug?]: Prepack script does not run on packages installed from git HOT 1
- [Bug?]: "ENOENT: no such file or directory, link ..." when configured for `nodeLinker: pnpm` and running in Docker with mounted filesystem HOT 3
- [Bug?]: yarn up does not update dependencies
- [Bug?]: `fs.watch` method returns incorrect object.
- [Bug?]: Types are not inferred correctly for dependency if type is from nested dependency
- [Bug?]: Error: EXDEV: cross-device link not permitted
- [Bug?]: Duplicated same-version packages in node_modules but not in yarn.lock HOT 3
- [Feature] Yarn environment variable for ".yarn" folder
- [Feature] Allow install platform environment flag when postinstall scripts are disabled HOT 1
- [Feature] Allow filter out non-warnings on `yarn explain peer-requirements`
- [Feature] Allow filter out non-warnings on yarn explain peer-requirements` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from berry.