Skip to content
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

[apollographql.vscode-apollo] Error: Command failed: npm list --production --parseable --depth=99999 --loglevel=error #87

Open
jankeromnes opened this issue Jul 20, 2020 · 8 comments

Comments

@jankeromnes
Copy link
Collaborator

We would like to auto-publish the extension apollographql.vscode-apollo from this repository, so we've added this configuration to extensions.json:

{
"id": "apollographql.vscode-apollo",
"repository": "https://github.com/apollographql/apollo-tooling",
"version": "1.16.6",
"checkout": "[email protected]",
"location": "packages/vscode-apollo",
"prepublish": "npx lerna bootstrap --hoist"
},

However, publishing it currently fails in our GitHub Action, with the following error log:

[FAIL] Could not process extension: {
  "id": "apollographql.vscode-apollo",
  "repository": "https://github.com/apollographql/apollo-tooling",
  "version": "1.16.6",
  "checkout": "[email protected]",
  "location": "packages/vscode-apollo",
  "prepublish": "npx lerna bootstrap --hoist"
}
Error: Command failed: npm list --production --parseable --depth=99999 --loglevel=error
npm ERR! missing: apollo-env@file:../apollo-env, required by [email protected]
npm ERR! missing: apollo-language-server@file:../apollo-language-server, required by [email protected]
npm ERR! missing: vscode-languageclient@^5.2.1, required by [email protected]

I've reported this error in their Spectrum community, but we haven't been able to find a solution yet:

https://spectrum.chat/apollo/graphql-tools/how-to-publish-vscode-apollo-extension-to-openvsx~a67485a1-e8b7-4e23-9b0a-f791b6ba1205

@jankeromnes jankeromnes changed the title [apollographql.vscode-apollo] [apollographql.vscode-apollo] Error: Command failed: npm list --production --parseable --depth=99999 --loglevel=error Jul 20, 2020
@jankeromnes
Copy link
Collaborator Author

I don't think I can efficiently troubleshoot this any further, as I don't understand the underlying tools well enough (lerna, ovsx).

@spoenemann Could you please take a look when you have time?

@jankeromnes
Copy link
Collaborator Author

Note: npm run package-extension does not fix this problem.

@spoenemann
Copy link
Collaborator

I'll have a look later this week.

@spoenemann
Copy link
Collaborator

We might need to add the argument --baseContentUrl https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo to ovsx:

https://github.com/apollographql/apollo-tooling/blob/cf69252f8573196826a1074fb6236bd8c53f0c3d/packages/vscode-apollo/package.json#L25

@jankeromnes this is not supported by the publishing script yet, right?

@jankeromnes
Copy link
Collaborator Author

jankeromnes commented Aug 3, 2020

@spoenemann Many thanks for helping to fix this!

Note: 05d6098 failed with:

[FAIL] Could not process extension: {
  "id": "apollographql.vscode-apollo",
  "repository": "https://github.com/apollographql/apollo-tooling",
  "version": "1.16.6",
  "checkout": "[email protected]",
  "location": "packages/vscode-apollo",
  "prepublish": "npm --prefix ../.. install && npm run _internal:prepare-extension"
}
Error: Command failed: npm --prefix ../.. install && npm run _internal:prepare-extension
npm WARN saveError ENOENT: no such file or directory, open '/package.json'
npm WARN saveError EACCES: permission denied, open '/package-lock.json.3193985890'
npm WARN enoent ENOENT: no such file or directory, open '/package.json'

I think it's because the prepublish step is run in /tmp/repository, while your ../.. makes it look like this should run in /tmp/repository/packages/vscode-apollo.

I'll add a cd packages/vscode-apollo && in front of the command to see if that helps.

@jankeromnes
Copy link
Collaborator Author

jankeromnes commented Aug 3, 2020

We might need to add the argument --baseContentUrl https://raw.githubusercontent.com/apollographql/apollo-tooling/master/packages/vscode-apollo to ovsx:

https://github.com/apollographql/apollo-tooling/blob/cf69252f8573196826a1074fb6236bd8c53f0c3d/packages/vscode-apollo/package.json#L25

@jankeromnes this is not supported by the publishing script yet, right?

Correct, baseContentUrl is not yet supported by this publishing script either.

I almost added support for it recently, but then I opted for just hot-patching the ambiguous URLs with sed instead (removing the need for baseContentUrl):

9992516

@jankeromnes
Copy link
Collaborator Author

@spoenemann Ok, cd packages/vscode-apollo && npm --prefix ../.. install && npm run _internal:prepare-extension now works in the CI, however ovsx publish still fails with the original error:

Running: git clone --recurse-submodules https://github.com/apollographql/apollo-tooling /tmp/repository
Running: git checkout [email protected]
Running: npm install
Running: cd packages/vscode-apollo && npm --prefix ../.. install && npm run _internal:prepare-extension
Creating Open VSX namespace failed -- assuming that it already exists
[FAIL] Could not process extension: {
  "id": "apollographql.vscode-apollo",
  "repository": "https://github.com/apollographql/apollo-tooling",
  "version": "1.16.6",
  "checkout": "[email protected]",
  "location": "packages/vscode-apollo",
  "prepublish": "cd packages/vscode-apollo && npm --prefix ../.. install && npm run _internal:prepare-extension"
}
Error: Command failed: npm list --production --parseable --depth=99999 --loglevel=error
npm ERR! missing: apollo-env@file:../apollo-env, required by [email protected]
npm ERR! invalid: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-language-server
npm ERR! peer dep missing: graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0, required by @apollographql/[email protected]
npm ERR! missing: @apollographql/apollo-tools@file:../apollo-tools, required by [email protected]
npm ERR! missing: apollo-env@file:../apollo-env, required by [email protected]
npm ERR! missing: apollo-graphql@file:../apollo-graphql, required by [email protected]
npm ERR! extraneous: @apollo/[email protected] /tmp/repository/packages/vscode-apollo/node_modules/@apollo/federation
npm ERR! extraneous: @apollographql/[email protected] /tmp/repository/packages/vscode-apollo/node_modules/@apollographql/graphql-language-service-interface
npm ERR! extraneous: @endemolshinegroup/[email protected] /tmp/repository/packages/vscode-apollo/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-datasource
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-language-server/node_modules/moment
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-link
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-link-context
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-link-error
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-link-http
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/apollo-server-errors
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/await-to-js
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/core-js
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/cosmiconfig
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/dotenv
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/glob
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/graphql-tag
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/lodash.debounce
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/lodash.merge
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/minimatch
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/vscode-languageserver
npm ERR! extraneous: [email protected] /tmp/repository/packages/vscode-apollo/node_modules/vscode-uri

@spoenemann
Copy link
Collaborator

Maybe we should support apollographql/apollo-tooling#2003 instead.

tennox pushed a commit to tennox/publish-extensions that referenced this issue Jan 21, 2022
tennox pushed a commit to tennox/publish-extensions that referenced this issue Jan 21, 2022
@spoenemann spoenemann removed their assignment Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants