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

Getting Started steps don't work on modern Node versions #10798

Open
graforlock opened this issue Jan 12, 2025 · 3 comments
Open

Getting Started steps don't work on modern Node versions #10798

graforlock opened this issue Jan 12, 2025 · 3 comments
Labels

Comments

@graforlock
Copy link

Describe the bug

Following getting started, we are meant to do lb4 app but that fails with _.gitignore

I see that loopback 4 supports very obscure and unmaintained version of node instead (v16).

Can that be made to support current LTS versions?


******@******-MacBook-Pro lb4 % node -v
v22.13.0
******@******-MacBook-Pro lb4 % lb4 app
? Project name: lb4
? Project description: lb4
? Project root directory: (lb4) lb4
>> Directory lb4 already exists.
******@******-MacBook-Pro lb4 % lb4 app
? Project description: app
? Project root directory: app
? Application class name: AppApplication
? Select features to enable in the project Enable eslint, Enable prettier, Enable mocha, Enable loopbackBuild, Enable vscode, Enable docker, Enable repositories, Enable services
? Yarn is available. Do you prefer to use it by default? No
node:events:502
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, scandir '/Users/******/lb4/app/_.gitignore'
    at Object.readdirSync (node:fs:1584:26)
    at exports.readdir (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/@mrmlnc/readdir-enhanced/lib/sync/fs.js:18:20)
    at Object.safeCall [as safe] (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/@mrmlnc/readdir-enhanced/lib/call.js:24:8)
    at DirectoryReader.readNextDirectory (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:78:10)
    at DirectoryReader.stream._read (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/@mrmlnc/readdir-enhanced/lib/directory-reader.js:57:18)
    at Readable.read (node:internal/streams/readable:739:12)
    at readdirSync (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/@mrmlnc/readdir-enhanced/lib/sync/index.js:27:21)
    at Function.readdirSyncStat (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/@mrmlnc/readdir-enhanced/lib/index.js:34:10)
    at ReaderSync.dynamicApi (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/fast-glob/out/providers/reader-sync.js:64:24)
    at ReaderSync.api (/opt/homebrew/lib/node_modules/@loopback/cli/node_modules/fast-glob/out/providers/reader-sync.js:56:25)
Emitted 'error' event on Readable instance at:
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/******/lb4/app/_.gitignore'
}

Logs

No response

Additional information

No response

Reproduction

Following https://loopback.io/getting-started.html tutorial on any LTS (or newer) Node

@graforlock graforlock added the bug label Jan 12, 2025
@dhmlau
Copy link
Member

dhmlau commented Jan 12, 2025

@graforlock, I was able to create a LoopBack4 app using the same version of Node.js as you do.

Here is my output:

% node -v
v22.13.0
% lb4 app
(node:91204) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
? Project name: test
? Project description: test
? Project root directory: test
? Application class name: TestApplication
? Select features to enable in the project Enable eslint, Enable prettier, Enable mocha, Enable loopbackBuild,
 Enable editorconfig, Enable vscode, Enable docker, Enable repositories, Enable services
    force test/.yo-rc.json
   create test/.editorconfig
   create test/.eslintignore
   create test/.eslintrc.js
   create test/.mocharc.json
   create test/.prettierignore
   create test/.prettierrc
   create test/DEVELOPING.md
   create test/package.json
   create test/tsconfig.json
   create test/.vscode/launch.json
   create test/.vscode/settings.json
   create test/.vscode/tasks.json
   create test/.gitignore
   create test/.dockerignore
   create test/Dockerfile
   create test/README.md
   create test/public/index.html
   create test/src/application.ts
   create test/src/index.ts
   create test/src/migrate.ts
   create test/src/openapi-spec.ts
   create test/src/sequence.ts
   create test/src/__tests__/README.md
   create test/src/controllers/README.md
   create test/src/controllers/index.ts
   create test/src/controllers/ping.controller.ts
   create test/src/datasources/README.md
   create test/src/models/README.md
   create test/src/repositories/README.md
   create test/src/__tests__/acceptance/home-page.acceptance.ts
   create test/src/__tests__/acceptance/ping.controller.acceptance.ts
   create test/src/__tests__/acceptance/test-helper.ts

No change to package.json was detected. No package manager install will be executed.
npm warn config cache-min This option has been deprecated in favor of `--prefer-offline`.
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 647 packages, and audited 648 packages in 5s

109 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

There's no _.gitignore file though, only .gitignore. Could you please run the following command to check which version of LB4 CLI you're using?

npm ls -g @loopback/cli

@uniconstructor
Copy link

uniconstructor commented Feb 4, 2025

Node 23.7.0 is also not supported at the moment: https://github.com/loopbackio/loopback-next/blob/master/package.json#L76

lb4 app
Node.js "23.7.0" is not supported. Please use a version that satisfies "18 || 20 || 22".

Should I expect any problems using Node 23.7.0 with latest Loopback 4?

@dhmlau
Copy link
Member

dhmlau commented Feb 5, 2025

I would think it works with Node.js 23. I've created PR#10826 to add it to CI.
If everything works fine, we can update the other package.json.

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

No branches or pull requests

3 participants