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

jlpm develop fails due to lack of buildutils/lib/develop.js file #7379

Closed
JasonWeill opened this issue May 23, 2024 · 7 comments · Fixed by #7382
Closed

jlpm develop fails due to lack of buildutils/lib/develop.js file #7379

JasonWeill opened this issue May 23, 2024 · 7 comments · Fixed by #7382
Labels

Comments

@JasonWeill
Copy link
Collaborator

In a fresh Conda environment with pip, python, and nodejs installed, I have the tip of the main branch of Notebook checked out. After running pip install -e ".[dev,test]" successfully, per the contributor docs, I run jlpm develop. This produces an error:

 jlpm develop
Installing /Users/jweill/git/notebook/notebook/labextension -> @jupyter-notebook/lab-extension
Removing: /opt/miniconda3/envs/notebook-20240523/share/jupyter/labextensions/@jupyter-notebook/lab-extension
Symlinking: /opt/miniconda3/envs/notebook-20240523/share/jupyter/labextensions/@jupyter-notebook/lab-extension -> /Users/jweill/git/notebook/notebook/labextension
node:internal/modules/cjs/loader:1146
  throw err;
  ^

Error: Cannot find module '/Users/jweill/git/notebook/buildutils/lib/develop.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.12.2

There is a buildutils directory under my local notebook repository, but there is no lib directory under it.

"develop": "jupyter labextension develop . --overwrite && node ./buildutils/lib/develop.js --overwrite",

The first command in the rvalue above succeeds. The latter does not, because the directory and file do not exist.

@JasonWeill JasonWeill added bug status:Needs Triage Applied to issues that need triage labels May 23, 2024
@JasonWeill
Copy link
Collaborator Author

I tried making the buildutils/lib directory, then rerunning jlpm develop, but I see the same problem as above.

@JasonWeill
Copy link
Collaborator Author

buildutils/src/develop.ts does exist, although the jupyter labextension develop command does not compile it to buildutils/lib/develop.js, as the latter node command requires.

@JasonWeill
Copy link
Collaborator Author

The develop command in the top-level package.json file was introduced in #6294, created by @jtpio and merged by @Zsailer , to merge in the RetroLab code base.

@jtpio
Copy link
Member

jtpio commented May 28, 2024

Looks like the buildutils package should be built to generate the file in the lib directory.

Would you be able to run jlpm run build && jlpm develop to see if that fixes the issue? If so maybe we should likely fix the scripts or the contributing docs.

Also at some point we tried to set up the nx.json to ease the development workflow: https://github.com/jupyter/notebook/blob/main/nx.json. But maybe this is also causing issues with some tasks being cached.

@JasonWeill
Copy link
Collaborator Author

With jlpm version 3.5.0 installed, I still get an error after running jlpm run build && jlpm develop in my notebook environment:

$ jlpm run build && jlpm develop
lerna notice cli v6.6.2
lerna info versioning independent

    ✔  @jupyter-notebook/application:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/buildutils:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/ui-components:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/lab-extension:build:lib  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/terminal-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/docmanager-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/documentsearch-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/tree:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/console-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/notebook-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/help-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/application-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/tree-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/app:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/lab-extension:build:labextension:dev  [local cache]
    ✔  @jupyter-notebook/lab-extension:build  [existing outputs match the cache, left as is]
    ✔  @jupyter-notebook/metapackage:build  [existing outputs match the cache, left as is]

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  Lerna (powered by Nx)   Successfully ran target build for 15 projects and 2 tasks they depend on (102ms)
 
   Nx read the output from the cache instead of running the command for 17 out of 17 tasks.
 
Installing /Users/jweill/git/notebook/notebook/labextension -> @jupyter-notebook/lab-extension
Removing: /opt/miniconda3/envs/notebook-20240523/share/jupyter/labextensions/@jupyter-notebook/lab-extension
Symlinking: /opt/miniconda3/envs/notebook-20240523/share/jupyter/labextensions/@jupyter-notebook/lab-extension -> /Users/jweill/git/notebook/notebook/labextension
node:internal/modules/cjs/loader:1146
  throw err;
  ^

Error: Cannot find module '/Users/jweill/git/notebook/buildutils/lib/develop.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.12.2

@JasonWeill
Copy link
Collaborator Author

Very odd: after checking out the main branch and rebasing from GitHub, jlpm build and then jlpm develop run without errors.

@JasonWeill
Copy link
Collaborator Author

Since this seems to be a docs issue rather than a code issue, I opened #7382 to update CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants