embedded-app-sdk icon indicating copy to clipboard operation
embedded-app-sdk copied to clipboard

error while install the package

Open LewdHuTao opened this issue 1 year ago • 8 comments

Hi, I think you guys forgot to change the version of the package while releasing this. Apparently when you try to install @discord/embedded-app-sdk you will get an error like this:

Update: pnpm does install the package fine but not npm

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:@discord/embedded-app-sdk@*

For anyone who gets this error, it can be easily fixed by changing the @discord/embedded-app-sdk version to '^1.0.0' in the packages/client/package.json file.

LewdHuTao avatar Mar 19 '24 03:03 LewdHuTao

What was the command you typed?

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/package.json#L3

https://www.npmjs.com/package/@discord/embedded-app-sdk?activeTab=versions

Malix-Labs avatar Mar 19 '24 06:03 Malix-Labs

What was the command you typed?

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/package.json#L3

https://www.npmjs.com/package/@discord/embedded-app-sdk?activeTab=versions

I tried to install the packages by doing npm i causing it return that error and if you go to examples/discord-activity-starter/packages/client/package.json you can see that the package is not yet updated to version 1.0.0

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/discord-activity-starter/packages/client/package.json#L10

LewdHuTao avatar Mar 19 '24 06:03 LewdHuTao

Same in the react-colyseus example!

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/react-colyseus/packages/client/package.json#L11

However, when using pnpm it does install, tho... Only npm doesn't know what to do...

These projects consume this repo's root @discord/embedded-app-sdk directly via pnpm workspaces

Source: docs/local-sdk-development.md#L8

Miniontoby avatar Mar 19 '24 15:03 Miniontoby

However, when using pnpm it does install, tho... Only npm doesn't know what to do...

Aah! That's why I didn't succeed to reproduce that issue

Malix-Labs avatar Mar 19 '24 15:03 Malix-Labs

Same in the react-colyseus example!

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/react-colyseus/packages/client/package.json#L11

However, when using pnpm it does install, tho... Only npm doesn't know what to do...

Apparently all example folders will return the same error. I don't know if they should update the package version or let people use pnpm only.

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/discord-activity-starter/packages/client/package.json#L10

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/nested-messages/package.json#L14

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/react-colyseus/packages/client/package.json#L11

https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/sdk-playground/packages/client/package.json#L17

LewdHuTao avatar Mar 19 '24 15:03 LewdHuTao

Same in the react-colyseus example! https://github.com/discord/embedded-app-sdk/blob/5cc3da806a8bc35b3a3b3c289975c7f14e662591/examples/react-colyseus/packages/client/package.json#L11

However, when using pnpm it does install, tho... Only npm doesn't know what to do...

Apparently all example folders will return the same error. I don't know if they should update the package version or let people use pnpm only.

I updated my comment, cause apparently it was mentioned:

These projects consume this repo's root @discord/embedded-app-sdk directly via pnpm workspaces

Miniontoby avatar Mar 19 '24 16:03 Miniontoby

This worked with me:

"@discord/embedded-app-sdk": "^1.0.0"

DiogenesYazan avatar Mar 19 '24 21:03 DiogenesYazan

I updated my comment

These projects consume this repo's root @discord/embedded-app-sdk directly via pnpm workspaces

It makes sense now why npm does not work

LewdHuTao avatar Mar 19 '24 22:03 LewdHuTao

The examples in this repo use pnpm — you'll need to run pnpm install before running the activity-starter example.

Outside of this repo you can install @discord/embedded-app-sdk with whatever package manger you prefer.

gabemeola avatar Mar 21 '24 17:03 gabemeola