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

Can't run npm run quickstart on main branch -> lerna bootstrap was removed in v7 #68

Open
jonas-w opened this issue Sep 26, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jonas-w
Copy link

jonas-w commented Sep 26, 2023

Description

Running npm run quickstart in a new environment, yields the following error

ERR! bootstrap The "bootstrap" command was removed by default in v7, and is no longer maintained.
ERR! bootstrap Learn more about this change at https://lerna.js.org/docs/legacy-package-management

Reproduce

  1. run npm run quickstart

Expected behavior

Build the repo.

Context

  • JupyterLite version: 0.2.0a1 ?
  • Operating System and version: ArchLinux
  • Browser and version: irrelevant
@jonas-w jonas-w added the bug Something isn't working label Sep 26, 2023
@jtpio
Copy link
Member

jtpio commented Sep 26, 2023

Thanks @jonas-w for reporting.

Looks like Lerna was updated to version 7 in #58.

Maybe we can just remove the bootstrap script. Would you like to open a PR? Thanks!

@jonas-w
Copy link
Author

jonas-w commented Sep 26, 2023

@jtpio I'm not really adapt with node/yarn/... but I tried something locally, and it seems like to do the same stuff as lerna bootstrap/lerna run, one would need to use yarn >2, which changes many things. I could publish my current state, but I don't know if this is really what you wanted.

@jtpio
Copy link
Member

jtpio commented Sep 26, 2023

would need to use yarn >2

Right, this should already be the case as the repo is now using jlpm which is a pinned version of Yarn 3 provided by JupyterLab.

So opening a PR that removes this line might be enough:

"bootstrap": "lerna bootstrap",

@jonas-w
Copy link
Author

jonas-w commented Sep 26, 2023

@jtpio thanks now it makes sense, but when I removed just that line the build scripts in the package subdirectory used the wrong python executable while the scripts in the root package.json used the correct python executable, I'm using a mamba/conda environment. That's why I tried using the yarn workspaces plugins for the lerna run commands, but this showed dependency errors with typescript and ts-jest.

EDIT: just checked, lerna also used the wrong python executable previously, don't know why I didn't have this error previously. lerna prepends /usr/bin in front of my PATH variables (and many other paths, but /usr/bin creates the problem).

EDIT2: Okay, previously I had a different work machine, which hadn't python in /usr/bin that's why this never happened until now. Is there an easy way to use the correct python executable other than ditching lerna completely?

@savakarrohan
Copy link
Contributor

I find the same problem but not the same error,

I agree that bootstrap can be removed thus appending

"bootstrap": "lerna bootstrap",

"quickstart": "npm run setup:py && jlpm && jlpm deduplicate && jlpm clean:all && jlpm bootstrap && jlpm lint && jlpm build:prod && jlpm dist && jlpm docs && jlpm test",

But I have tried a few items before that, it appe

Build windows with conda env

jlpm clean:all error involved in the quickstart command.
It was regarding removal of particular file in the .cache folder

Building from a docker container Ubuntu

Firstly,
I noticed that the readme has

pyodide-kernel/README.md

Lines 130 to 132 in 1bf33bf

- `git`
- `nodejs 20`
- `python >=3.8`

Whereas the contributing has

### Prerequisites
- `git`
- `python >=3.8`
- `nodejs >=18,<19`

Using the container, which had git, conda,
I tested in either nodejs versions but appear to be stuck with errors involving the packages such as
I individually ran each jlpm ... command in quickstart

(base) root@590fa2df78c0:/code# jlpm build:prod
lerna notice cli v7.3.0
lerna info versioning independent

 >  Lerna (powered by Nx)   Running target build:prod for 2 projects and 1 task they depend on:

    - @jupyterlite/pyodide-kernel
    - @jupyterlite/pyodide-kernel-extension

> @jupyterlite/pyodide-kernel:"build:py"

@jupyterlite/pyodide-kernel: fatal: not a git repository: /code/../.git/modules/pyodide-kernel
@jupyterlite/pyodide-kernel: Traceback (most recent call last):
@jupyterlite/pyodide-kernel:   File "/code/packages/pyodide-kernel/scripts/generate-wheels-js.py", line 32, in <module> 
@jupyterlite/pyodide-kernel:     subprocess.check_output([which("git"), "log", "-1", "--format=%ct"])
@jupyterlite/pyodide-kernel:   File "/root/miniconda3/lib/python3.11/subprocess.py", line 466, in check_output
@jupyterlite/pyodide-kernel:     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
@jupyterlite/pyodide-kernel:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@jupyterlite/pyodide-kernel:   File "/root/miniconda3/lib/python3.11/subprocess.py", line 571, in run
@jupyterlite/pyodide-kernel:     raise CalledProcessError(retcode, process.args,
@jupyterlite/pyodide-kernel: subprocess.CalledProcessError: Command '['/usr/bin/git', 'log', '-1', '--format=%ct']' returned non-zero exit status 128.

 >  Lerna (powered by Nx)   Running target build:prod for 2 projects and 1 task they depend on failed

   Tasks not run because their dependencies failed or --nx-bail=true:

   - @jupyterlite/pyodide-kernel:build:prod
   - @jupyterlite/pyodide-kernel-extension:build:prod

   Failed tasks:

   - @jupyterlite/pyodide-kernel:build:py

So It seems that the packages aren't built so I tried building them individually but I get the following set of errors

(base) root@590fa2df78c0:/code/packages/pyodide-kernel# jlpm build
src/kernel.ts:12:45 - error TS2307: Cannot find module './_pypi' or its corresponding type declarations.

12 import { allJSONUrl, pipliteWheelUrl } from './_pypi';
                                               ~~~~~~~~~

src/index.ts:4:15 - error TS2307: Cannot find module './_pypi' or its corresponding type declarations.

4 export * from './_pypi';
                ~~~~~~~~~


Found 2 errors.

@savakarrohan
Copy link
Contributor

My error was related to the .git folder not moving in to the docker container
And the windows path being too long,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants