自定义 jupyter labextension 安装失败
Custom jupyter labextension fails to install
我们有一个自定义的 jupyterlab 扩展无法安装 nodejs=14.14.0(和 15.2.1)(使用 conda 安装)。
以下是 package.json 文件的 labextension 的样子:
{
"name": "my-custom-ext",
"version": "0.1.0",
"description": "Integrate JupyterLab with ext",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/my_name/myextension",
"bugs": {
"url": "https://github.com/my_name/myextension/issues"
},
"license": "BSD-3-Clause",
"author": "xyz",
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/my_name/myextension.git"
},
"scripts": {
"build": "tsc",
"clean": "rimraf lib",
"prepare": "npm run clean && npm run build",
"watch": "tsc -w"
},
"dependencies": {
"@jupyterlab/application": "^3.0.6",
"@jupyterlab/apputils": "^3.0.5",
"@jupyterlab/coreutils": "^5.0.3",
"@jupyterlab/docregistry": "^3.0.6",
"@jupyterlab/launcher": "^3.0.5",
"@jupyterlab/mainmenu": "^3.0.5",
"@jupyterlab/notebook": "^3.0.6",
"@jupyterlab/services": "^6.0.5",
"@lumino/commands": "^1.12.0",
"@lumino/coreutils": "^1.5.3",
"@lumino/disposable": "^1.4.3",
"@lumino/widgets": "^1.16.1"
},
"devDependencies": {
"@jupyterlab/builder": "^3.0.0",
"rimraf": "^3.0.2",
"typescript": "~4.1.3"
},
"jupyterlab": {
"extension": true
}
}
这是错误 jupyter labextension install --no-build my-custom-ext
:
Node v14.14.0
Yarn configuration loaded.
> node /opt/conda/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-yarn install v1.21.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning @blueprintjs/core@3.52.0: Invalid bin entry for "upgrade-blueprint-2.0.0-rename" (in "@blueprintjs/core").
warning @blueprintjs/core@3.52.0: Invalid bin entry for "upgrade-blueprint-3.0.0-rename" (in "@blueprintjs/core").
error @npmcli/fs@1.1.0: The engine "node" is incompatible with this module. Expected version "^12.13.0 || ^14.15.0 || >=16". Got "14.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> /opt/conda/bin/npm pack /home/jovyan/my-custom-ext
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-
> my-custom-ext@0.1.0 prepare /home/jovyan/my-custom-ext
> npm run clean && npm run build
> my-custom-ext@0.1.0 clean /home/jovyan/my-custom-ext
> rimraf lib
> my-custom-ext@0.1.0 build /home/jovyan/my-custom-ext
> tsc
src/index.ts(1,72): error TS2307: Cannot find module '@jupyterlab/apputils' or its corresponding type declarations.
....
....
....
ValueError: "/home/jovyan/my-custom-ext" is not a valid npm package
Exiting application: lab
运行 “npm ls” 我得到了:
├─┬ @jupyterlab/builder@3.2.5
│ ├─┬ terser-webpack-plugin@4.2.3
│ │ ├─┬ cacache@15.3.0
│ │ │ ├─┬ @npmcli/fs@1.1.0
已将 package.json 更改为:
"devDependencies": {
"@jupyterlab/builder": "=3.2.4",......
但这并没有帮助。仍然有同样的错误
注意:https://www.npmjs.com/package/@npmcli/fs:1.1.0 已于 5 天前发布。
请帮忙解决
此片段相关:
Expected version "^12.13.0 || ^14.15.0 || >=16". Got "14.14.0"
它告诉您需要使用节点 14.15.0
或更新的节点 14.x,并且您不能使用 13.x、15.x。但是你有 14.14.0
- 这意味着你需要升级你的 node.js.
您提到了 conda - 可能是您使用了过时的默认频道,因此您获得了 14.x 的旧次要版本; conda-forge
频道有所有版本,我建议切换到它。如果您已经使用 conda-forge
并且无法获得更新的版本,您可能想尝试使用 mamba
因为它有更好的依赖解析器。
注意:JupyterLab 3.x 目前还没有很好地支持 15.x 和更新版本(除其他外,因为并非所有依赖项都升级到 16.x,因为节点遵循奇偶版本节奏,其中只有偶数的数量足够稳定,足以让更广泛的生态系统有迁移的动力。
我们有一个自定义的 jupyterlab 扩展无法安装 nodejs=14.14.0(和 15.2.1)(使用 conda 安装)。
以下是 package.json 文件的 labextension 的样子:
{
"name": "my-custom-ext",
"version": "0.1.0",
"description": "Integrate JupyterLab with ext",
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension"
],
"homepage": "https://github.com/my_name/myextension",
"bugs": {
"url": "https://github.com/my_name/myextension/issues"
},
"license": "BSD-3-Clause",
"author": "xyz",
"files": [
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}"
],
"main": "lib/index.js",
"types": "lib/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/my_name/myextension.git"
},
"scripts": {
"build": "tsc",
"clean": "rimraf lib",
"prepare": "npm run clean && npm run build",
"watch": "tsc -w"
},
"dependencies": {
"@jupyterlab/application": "^3.0.6",
"@jupyterlab/apputils": "^3.0.5",
"@jupyterlab/coreutils": "^5.0.3",
"@jupyterlab/docregistry": "^3.0.6",
"@jupyterlab/launcher": "^3.0.5",
"@jupyterlab/mainmenu": "^3.0.5",
"@jupyterlab/notebook": "^3.0.6",
"@jupyterlab/services": "^6.0.5",
"@lumino/commands": "^1.12.0",
"@lumino/coreutils": "^1.5.3",
"@lumino/disposable": "^1.4.3",
"@lumino/widgets": "^1.16.1"
},
"devDependencies": {
"@jupyterlab/builder": "^3.0.0",
"rimraf": "^3.0.2",
"typescript": "~4.1.3"
},
"jupyterlab": {
"extension": true
}
}
这是错误 jupyter labextension install --no-build my-custom-ext
:
Node v14.14.0
Yarn configuration loaded.
> node /opt/conda/lib/python3.8/site-packages/jupyterlab/staging/yarn.js install
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-yarn install v1.21.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning @blueprintjs/core@3.52.0: Invalid bin entry for "upgrade-blueprint-2.0.0-rename" (in "@blueprintjs/core").
warning @blueprintjs/core@3.52.0: Invalid bin entry for "upgrade-blueprint-3.0.0-rename" (in "@blueprintjs/core").
error @npmcli/fs@1.1.0: The engine "node" is incompatible with this module. Expected version "^12.13.0 || ^14.15.0 || >=16". Got "14.14.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> /opt/conda/bin/npm pack /home/jovyan/my-custom-ext
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-
> my-custom-ext@0.1.0 prepare /home/jovyan/my-custom-ext
> npm run clean && npm run build
> my-custom-ext@0.1.0 clean /home/jovyan/my-custom-ext
> rimraf lib
> my-custom-ext@0.1.0 build /home/jovyan/my-custom-ext
> tsc
src/index.ts(1,72): error TS2307: Cannot find module '@jupyterlab/apputils' or its corresponding type declarations.
....
....
....
ValueError: "/home/jovyan/my-custom-ext" is not a valid npm package
Exiting application: lab
运行 “npm ls” 我得到了:
├─┬ @jupyterlab/builder@3.2.5
│ ├─┬ terser-webpack-plugin@4.2.3
│ │ ├─┬ cacache@15.3.0
│ │ │ ├─┬ @npmcli/fs@1.1.0
已将 package.json 更改为:
"devDependencies": {
"@jupyterlab/builder": "=3.2.4",......
但这并没有帮助。仍然有同样的错误
注意:https://www.npmjs.com/package/@npmcli/fs:1.1.0 已于 5 天前发布。
请帮忙解决
此片段相关:
Expected version "^12.13.0 || ^14.15.0 || >=16". Got "14.14.0"
它告诉您需要使用节点 14.15.0
或更新的节点 14.x,并且您不能使用 13.x、15.x。但是你有 14.14.0
- 这意味着你需要升级你的 node.js.
您提到了 conda - 可能是您使用了过时的默认频道,因此您获得了 14.x 的旧次要版本; conda-forge
频道有所有版本,我建议切换到它。如果您已经使用 conda-forge
并且无法获得更新的版本,您可能想尝试使用 mamba
因为它有更好的依赖解析器。
注意:JupyterLab 3.x 目前还没有很好地支持 15.x 和更新版本(除其他外,因为并非所有依赖项都升级到 16.x,因为节点遵循奇偶版本节奏,其中只有偶数的数量足够稳定,足以让更广泛的生态系统有迁移的动力。