Closed fuji44 closed 2 months ago
Workaround: Running Visual Studio Code or PowerShell as a administrator works for me, the deno team in version 1.46.2 use symlinks when node_modules is created.
It is certainly possible if you run it with administrator privileges.
I could also do it by adding my own user to the local security policy SeCreateSymbolicLinkPrivilege
. I have not tried this, but it also seems to be possible with developer mode enabled.
For the time being, I will try to work around this by granting permission to create symbolic links only to my own users.
It makes sense to structure the package with symbolic links, and I personally support this. However, we also want to avoid compromising the development experience.
For my part, I think a good compromise would be to give users the authority to create symbolic links on the windows side, but I am not happy with the hassle involved. If this is going to be the default work going forward, it needs to be added to the installation docs.
I think the pnpm approach would be useful as a way to address this on the deno side.
Probably caused by #25164
Can you try again in deno canary (deno upgrade canary
) - I think the error will persist, but the message should be more useful. Could you send over that error message?
@lucacasonato That didn't strike me as a straightforward message about the cause.
> deno --version
deno 2.0.0-rc.0+42cf762 (canary, release, x86_64-pc-windows-msvc)
v8 12.9.202.5-rusty
typescript 5.5.2
> deno run main.ts
error: Could not find a matching package for 'npm:is-even' in a package.json file. You must specify this as a package.json dependency when the node_modules folder is not managed by Deno.
at file:///C:/Users/fuji44/git/file-manager-x/main.ts:1:20
Reading the last error message makes me wonder if it's related to https://github.com/denoland/deno/issues/25355 . Do you happen to use a workspaces for your project?
Workspace is not used. Additional experimentation has shown that the problem occurs depending on the presence or absence of package.json.
The experimental procedure is as follows. Add files to the new directory as follows and run main.ts at each step. I experimented with v1.46.2 and canary.
The result is an error only in step 3 for both versions. However, the canary error message seems to be about something other than this issue, since only canary causes an error when step 3 is performed with permission to create a symbolic link.
By the way, I don't want to use package.json, but prisma cli creates it on its own, so I have no choice.
Yeah this is a regression from https://github.com/denoland/deno/pull/25164.
We use symlinks, and are supposed to fall back to junctions if symlinking isn't permitted, but the fallback logic must be incorrect. I'll look into this.
This should now be fixed in the latest version of deno (1.46.3).
Try it out and feel free to reopen this issue if it still isn't working for you
Works fine. Thanks for the quick response.
After upgrading to Deno 1.46.2 on Windows, when I try to run a new script that uses the npm package, I get the following error and cannot run it.
I rewrote a very simple script and npm package to isolate the problem, but the result was the same.
Additionally, we tried clearing the cache and degrading to v1.46.1. The result is that the error occurs only with v1.46.2.
By the way, there is no problem on Ubuntu 22.04 on WSL.