Unable to install "@tableau/embedding-api" using yarn
Hello,
for some reason when installing package with yarn it does not find some of the packages.
i created a clean project with no dependencies and used yarn add @tableau/embedding-api
$ yarn add @tableau/embedding-api --verbose
yarn add v1.22.19
verbose 0.4657057 current time: 2024-04-03T06:37:04.188Z
[1/4] Resolving packages...
verbose 0.7773877 Performing "GET" request to "https://registry.yarnpkg.com/@tableau%2fembedding-api".
verbose 2.4755437 Request "https://registry.yarnpkg.com/@tableau%2fembedding-api" finished with status code 200.
verbose 2.477336 Performing "GET" request to "https://registry.yarnpkg.com/@tableau%2fapi-external-contract-js".
verbose 2.478122 Performing "GET" request to "https://registry.yarnpkg.com/@tableau%2fapi-internal-contract-js".
verbose 2.4787556 Performing "GET" request to "https://registry.yarnpkg.com/@tableau%2fapi-shared-js".
verbose 3.2612582 Request "https://registry.yarnpkg.com/@tableau%2fapi-shared-js" finished with status code 404.
verbose 3.2924577 Request "https://registry.yarnpkg.com/@tableau%2fapi-internal-contract-js" finished with status code 404.
verbose 3.3581252 Request "https://registry.yarnpkg.com/@tableau%2fapi-external-contract-js" finished with status code 404.
verbose 3.3659601 Error: Couldn't find package "@tableau/[email protected]" required by "@tableau/embedding-api" on the "npm" registry.
at MessageError.ExtendableBuiltin (C:\Users\olegm\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:721:66)
at new MessageError (C:\Users\olegm\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:750:123)
at PackageRequest.
@oliqwe I had this same problem and managed to find a workaround. First I had to use npm (version 10.5.0) to do an initial install of the embedding API:
$ npm i @tableau/embedding-api
The "private" libraries are bundled with the base package, so once the base package was installed, I added a resolutions section to my package.json file:
"resolutions": {
"@tableau/api-external-contract-js": "file:./node_modules/@tableau/embedding-api/node_modules/@tableau/api-external-contract-js",
"@tableau/api-internal-contract-js": "file:./node_modules/@tableau/embedding-api/node_modules/@tableau/api-internal-contract-js",
"@tableau/api-shared-js": "file:./node_modules/@tableau/embedding-api/node_modules/@tableau/api-shared-js"
},
Now I can run yarn install to maintain my other packages without hitting the permissions/404 error with the private libraries.
Same problem with pnpm:
ERR_PNPM_FETCH_404 GET https://registry.npmjs.org/@tableau%2Fapi-internal-contract-js: Not Found - 404
This error happened while installing the dependencies of @tableau/[email protected]
@tableau/api-internal-contract-js is not in the npm registry, or you have no permission to fetch it.
No authorization header was set for the request.
Given a monorepo setup, the package.json snippet looks like:
"pnpm": {
"overrides": {
"@tableau/api-external-contract-js": "file:./libs/shared/feature/tableau/node_modules/.ignored/@tableau/embedding-api/node_modules/@tableau/api-external-contract-js",
"@tableau/api-internal-contract-js": "file:./libs/shared/feature/tableau/node_modules/.ignored/@tableau/embedding-api/node_modules/@tableau/api-internal-contract-js",
"@tableau/api-shared-js": "file:./libs/shared/feature/tableau/node_modules/.ignored/@tableau/embedding-api/node_modules/@tableau/api-shared-js"
}
}
This is because yarn 2 does not support bundle dependencies, which the package currently leverages to include those internal packages. https://yarnpkg.com/migration/guide#dont-use-bundledependencies
Team is aware of the issue but no ETA to share yet.