jupytercalpoly/jupyterlab-code-snippets

the extension could not be installed

Betristor opened this issue · 4 comments

Describe the bug
The extension could not be installed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to extension file folder
  2. run npm install
  3. the conflict of npm packages is shown

Expected behavior
code-snippets extension is successfully built.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: MacOS Monterey 12.3
  • Browser chrome

Additional context
Log from npm

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: jupyterlab-code-snippets@2.1.0
npm ERR! Found: eslint@7.32.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^7.5.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0" from @typescript-eslint/parser@2.34.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   dev @typescript-eslint/parser@"^2.27.0" from the root project
npm ERR!   peer @typescript-eslint/parser@"^2.0.0" from @typescript-eslint/eslint-plugin@2.34.0
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR!     dev @typescript-eslint/eslint-plugin@"^2.27.0" from the root project

Similar problem on Linux. There we get:

  $ tsc
      src/index.ts(298,14): error TS2322: Type 'Token<ISettingRegistry>' is not assignable to type 'Token<any>'.
        Types have separate declarations of a private property '_tokenStructuralPropertyT'.
      error Command failed with exit code 1.
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
      error Command failed with exit code 1.
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
      error Command failed with exit code 1.
      info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
      Traceback (most recent call last):

during pip install

I can successfully install it using pip on OSX, but encounter similar problem that it has no contents.
I found this could be caused by the error in its default snippets, and it works after clean the default snippets in the Advanced Settings Editor.

@hhhuang18 Looking at the system defaults snippet, the id attribute of the first snippet is missing, which may be the problem?

The attribute does appear in the definition file in the codebase (eg

) but not in the system default file when the extension is installed:

image

@psychemedia, adding "id": 0, to the first snippet indeed fixes the issue. Well spotted!