-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Deno add - "Failed to install from package.json" "Unexpected character." #26653
Comments
Do you also have a |
I tried reproducing the problem and with provided |
@bartlomieju Sure what would you like to see? To answer your question, there is no package.json. $ ls -al
total 40
drwxr-xr-x@ 9 njenning staff 288 Oct 31 01:26 .
drwxr-xr-x@ 15 njenning staff 480 Aug 26 23:06 ..
-rw-r--r--@ 1 njenning staff 1077 Aug 26 23:06 LICENSE
-rw-r--r--@ 1 njenning staff 271 Aug 29 14:54 README.md
drwxr-xr-x@ 2 njenning staff 64 Oct 31 01:24 coverage
-rw-r--r--@ 1 njenning staff 823 Oct 31 01:26 deno.json
-rw-r--r--@ 1 njenning staff 5814 Aug 27 17:53 deno.lock
drwxr-xr-x@ 4 njenning staff 128 Aug 27 17:44 scripts
drwxr-xr-x@ 12 njenning staff 384 Oct 31 01:23 src
$ deno add npm:debug
Add npm:[email protected]
error: Failed to install from package.json
Caused by:
0: Invalid version requirement
1: Unexpected character.
^
~ It might be worth mentioning that this is a mono-repo, however I've never had issues converting packages one at a time with deno 1.45, it was only upgrading to 2.0.x that I started getting issues like this. |
@silverbucket is your reo public so o could try it myself? |
We should improve this error message to say the file the error occurs in. Probably there's a package.json in the workspace in this case. |
@bartlomieju Here's the repo + branch + package in the mono repo where I ran those commands: https://github.com/sockethub/sockethub/tree/migrate-to-deno/packages/schemas But while I was checking the modified files to commit and update that branch before I wrote this message, I noticed that the root package.json was modified with the debug dependencies. This goes along with what @dsherret was suggesting. So, for some reason, using
|
I opened #26665 which should help reduce the confusion slightly in the future. It will say the package.json file and the dependency that caused the issue.
@nathanwhit could you take a look? I don't think it should be doing that. |
Deno prefers to add |
Using deno project-root/packages/schemas $ deno install
error: Failed to install '@sockethub/client'
at file:///project-root/packages/examples/package.json
Caused by:
0: Invalid version requirement
1: Unexpected character.
^
~ |
@nathanwhit Should I create a new ticket? Or can you re-open this one? |
Hmm we're putting the dependency in the correct file now, but we error out because we validate all of the I feel like maybe we should make |
@nathanwhit we should just support it, see #26726 |
Version: Deno 2.0.4
The text was updated successfully, but these errors were encountered: