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

Internal Error: This package doesn't seem to be present in your lockfile #15107

Closed
BoPeng opened this issue Sep 12, 2023 · 2 comments
Closed
Labels
bug status:Needs Info status:Needs Triage Applied to new issues that need triage

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Sep 12, 2023

Bug Report

Steps to Reproduce:

  1. create a test project test_extension
copier copy https://github.com/jupyterlab/extension-template .

🎤 What is your extension kind?
   frontend
🎤 Extension author name
   Bo
🎤 Extension author email
   ben.bob@gmail.com
🎤 JavaScript package name
   myextension
🎤 Python package name
   myextension
🎤 Extension short description
   A JupyterLab extension.
🎤 Does the extension have user settings?
   No
🎤 Do you want to set up Binder example?
   No
🎤 Do you want to set up tests for the extension?
   No
🎤 Git remote repository URL
   https://github.com/github_username/my-extension
  1. npm install
  2. npm run build

> myextension@0.1.0 build
> jlpm build:lib && jlpm build:labextension:dev

Internal Error: myextension@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
    at q0.getCandidates (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:435:5145)
    at xf.getCandidates (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:391:1264)
    at /Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:7693
    at ff (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:390:11070)
    at ge (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:7673)
    at async Promise.allSettled (index 0)
    at async to (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:390:10398)
    at async /Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:8205
    at async ti.startProgressPromise (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:390:47579)
    at async je.resolveEverything (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:6233)
  1. yarn install as suggested
$ yarn install
yarn install v1.22.18
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "@jupyterlab/application > @jupyterlab/ui-components@4.0.5" has unmet peer dependency "react@^18.2.0".
warning "@jupyterlab/application > @jupyterlab/services > @jupyterlab/settingregistry@4.0.5" has unmet peer dependency "react@>=16".
warning " > css-loader@6.8.1" has unmet peer dependency "webpack@^5.0.0".
warning " > style-loader@3.3.3" has unmet peer dependency "webpack@^5.0.0".
warning " > source-map-loader@1.1.3" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
✨  Done in 24.96s.
  1. the problem persists.
$ npm run build

> myextension@0.1.0 build
> jlpm build:lib && jlpm build:labextension:dev

Internal Error: myextension@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
    at q0.getCandidates (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:435:5145)
    at xf.getCandidates (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:391:1264)
    at /Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:7693
    at ff (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:390:11070)
    at ge (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:7673)
    at async Promise.allSettled (index 0)
    at async to (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:390:10398)
    at async /Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:8205
    at async ti.startProgressPromise (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:390:47579)
    at async je.resolveEverything (/Users/bpeng/anaconda3/envs/vatlab/lib/python3.10/site-packages/jupyterlab/staging/yarn.js:439:6233)
  1. Tried yarn cache clean and the problem persists.

Expected Result:

npm run build should pass with the test project. I was actually working on my own extension and got really confused with this error, then I found that it might not be a problem with my own project but with the toolchain that I am using.

Environment:

macOS Version 13.2.1 (22D68)

$ python --version
Python 3.10.12
$ node -v
v20.6.1
$  npm -v
9.8.1
$ yarn -v
1.22.18
$ pip list | grep jupyterlab
jupyterlab                    4.0.5
jupyterlab-pygments           0.2.2
jupyterlab_server             2.24.0
@JasonWeill
Copy link
Contributor

Have you tried running only jlpm, not yarn or npm? Despite what the errors say, jlpm is a name for our use of yarn, so using jlpm consistently will ensure that you get the same version every time. jlpm is Yarn v3 in JupyterLab v4, but your system has yarn v1.

We may need to update the documentation if it makes reference to yarn and npm.

@BoPeng
Copy link
Contributor Author

BoPeng commented Sep 13, 2023

It was very confusing when I noticed that yarn 1.22.19 is the latest version on npm. Then searching for Yarn 3 lands me at this post and command

yarn set version stable

which changed my yarn to

> yarn --version
3.6.3

and the project can now be compiled successfully.

Note: I did not notice the information on version of Yarn on the developer guide, but I should have read the extension migraiton guide, which mentions Yarn 3.

@BoPeng BoPeng closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status:Needs Info status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants