blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

I'm not able to create a new project using Node v14.10 #328

Closed fredmaiaarantes closed 3 years ago

fredmaiaarantes commented 3 years ago

What is the problem?

I'm not able to create a new project using Node v14.10 on my Ubuntu 20.04 machine. I ran the creation command (blitz new myApp) and nothing happens, the current folder remains empty. Then I ran the same command but using sudo and got this message: 'You are using an unsupported version of Node.js. Please switch to v12 or newer'.

After that I switched to Node v12.18.3 and it worked fine. So, I believe there is an issue with Blitz on Node v14.

What are detailed steps to reproduce this?

  1. yarn global add blitz

  2. blitz new myApp No folder is created, the project itself is not created and there are no error messages. I tried again using sudo.

  3. sudo blitz new myApp. Got this error now: 'You are using an unsupported version of Node.js. Please switch to v12 or newer.'

  4. nvm use v12.18.3

  5. blitz new myApp

It works and the project is created.

Run blitz -v and paste the output here:

You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

Linux 5.8 | linux-x64 | Node: v14.10.0

blitz: 0.30.1 (global)

  Package manager: npm 
  System:
    OS: Linux 5.8 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.99 GB / 31.01 GB
    Shell: 5.8 - /home/linuxbrew/.linuxbrew/bin/zsh
  Binaries:
    Node: 14.10.0 - ~/.nvm/versions/node/v14.10.0/bin/node
    Yarn: 1.22.5 - ~/.nvm/versions/node/v14.10.0/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.10.0/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found

This is my first opened issue so, let me know what can I do better next time.

All the steps are below:

2021-02-19_11-47

➜  blitz-projects yarn global add blitz    
yarn global v1.22.5
[1/4] Resolving packages...
warning blitz > eslint-config-blitz > babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
warning blitz > jest-environment-jsdom-fourteen > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning blitz > jest-environment-jsdom-fourteen > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning blitz > jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
[2/4] Fetching packages...
info @expo/traveling-fastlane-darwin@1.15.1: The platform "linux" is incompatible with this module.
info "@expo/traveling-fastlane-darwin@1.15.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-darwin-ia32@2.2.8: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-darwin-ia32@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-darwin-ia32@2.2.8: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-darwin-x64@2.2.8: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-darwin-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-freebsd-ia32@2.2.8: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-freebsd-ia32@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-freebsd-ia32@2.2.8: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-freebsd-x64@2.2.8: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-freebsd-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-arm@2.2.8: The CPU architecture "x64" is incompatible with this module.
info "@expo/ngrok-bin-linux-arm@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-arm64@2.2.8: The CPU architecture "x64" is incompatible with this module.
info "@expo/ngrok-bin-linux-arm64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-linux-ia32@2.2.8: The CPU architecture "x64" is incompatible with this module.
info "@expo/ngrok-bin-linux-ia32@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-sunos-x64@2.2.8: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-sunos-x64@2.2.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-win32-ia32@2.2.8-beta.1: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-win32-ia32@2.2.8-beta.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/ngrok-bin-win32-ia32@2.2.8-beta.1: The CPU architecture "x64" is incompatible with this module.
info @expo/ngrok-bin-win32-x64@2.2.8-beta.1: The platform "linux" is incompatible with this module.
info "@expo/ngrok-bin-win32-x64@2.2.8-beta.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo-cli > @expo/xdl > @expo/dev-server > @expo/metro-config > metro-react-native-babel-transformer@0.58.0" has unmet peer dependency "@babel/core@*".
warning "blitz > @testing-library/react@11.2.5" has unmet peer dependency "react@*".
warning "blitz > @testing-library/react@11.2.5" has unmet peer dependency "react-dom@*".
warning "blitz > @testing-library/react-hooks@4.0.1" has unmet peer dependency "react@>=16.9.0".
warning "blitz > @testing-library/react-hooks@4.0.1" has incorrect peer dependency "react-test-renderer@>=16.9.0".
warning "blitz > @blitzjs/babel-preset > babel-plugin-superjson-next@0.2.1" has unmet peer dependency "next@>=9.0.0".
warning "blitz > @blitzjs/babel-preset > babel-plugin-superjson-next@0.2.1" has unmet peer dependency "react@>=16.X".
warning "blitz > @blitzjs/babel-preset > babel-plugin-superjson-next@0.2.1" has unmet peer dependency "superjson@1.x".
warning "blitz > ts-jest@26.5.1" has unmet peer dependency "typescript@>=3.8 <5.0".
warning "blitz > react-test-renderer@0.0.0-experimental-3310209d0" has unmet peer dependency "react@0.0.0-experimental-3310209d0".
warning "blitz > @blitzjs/cli > ts-node@9.1.1" has unmet peer dependency "typescript@>=2.7".
warning "blitz > @blitzjs/generator > jscodeshift@0.11.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning "blitz > eslint-config-blitz > eslint-config-react-app@6.0.0" has unmet peer dependency "eslint@^7.5.0".
warning "blitz > eslint-config-blitz > babel-eslint@10.1.0" has unmet peer dependency "eslint@>= 4.12.1".
warning "blitz > eslint-config-blitz > eslint-plugin-cypress@2.11.2" has unmet peer dependency "eslint@>= 3.2.1".
warning "blitz > eslint-config-blitz > eslint-plugin-import@2.22.1" has unmet peer dependency "eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0".
warning "blitz > eslint-config-blitz > eslint-plugin-jsx-a11y@6.4.1" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7".
warning "blitz > eslint-config-blitz > eslint-plugin-flowtype@5.2.2" has unmet peer dependency "eslint@^7.1.0".
warning "blitz > eslint-config-blitz > eslint-plugin-react@7.22.0" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7".
warning "blitz > @blitzjs/installer > ink-spinner@4.0.1" has incorrect peer dependency "react@^16.8.2".
warning "blitz > @blitzjs/installer > ink@3.0.8" has incorrect peer dependency "react@>=16.8.0".
warning "blitz > eslint-config-blitz > eslint-plugin-react-hooks@4.2.0" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0".
warning "blitz > eslint-config-blitz > @typescript-eslint/eslint-plugin@4.14.2" has unmet peer dependency "eslint@^5.0.0 || ^6.0.0 || ^7.0.0".
warning "blitz > eslint-config-blitz > @typescript-eslint/parser@4.14.2" has unmet peer dependency "eslint@^5.0.0 || ^6.0.0 || ^7.0.0".
warning "blitz > @blitzjs/server > null-loader@4.0.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "blitz > react-test-renderer > react-shallow-renderer@16.14.1" has unmet peer dependency "react@^16.0.0 || ^17.0.0".
warning "blitz > @blitzjs/core > react-query@2.5.12" has unmet peer dependency "react@^16.8.0".
warning "blitz > @blitzjs/server > next@10.0.7" has unmet peer dependency "react@^16.6.0 || ^17".
warning "blitz > @blitzjs/server > next@10.0.7" has unmet peer dependency "react-dom@^16.6.0 || ^17".
warning "blitz > @blitzjs/installer > ink > react-reconciler@0.24.0" has incorrect peer dependency "react@^16.0.0".
warning "blitz > eslint-config-blitz > @typescript-eslint/eslint-plugin > tsutils@3.20.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "blitz > eslint-config-blitz > @typescript-eslint/eslint-plugin > @typescript-eslint/experimental-utils@4.14.2" has unmet peer dependency "eslint@*".
warning "blitz > @blitzjs/server > next > use-subscription@1.5.1" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "blitz > @blitzjs/server > next > styled-jsx@3.3.2" has unmet peer dependency "react@15.x.x || 16.x.x || 17.x.x".
warning "blitz > @blitzjs/server > next > @next/react-dev-overlay@10.0.7" has unmet peer dependency "react@^16.9.0 || ^17".
warning "blitz > @blitzjs/server > next > @next/react-dev-overlay@10.0.7" has unmet peer dependency "react-dom@^16.9.0 || ^17".
[4/4] Building fresh packages...
success Installed "blitz@0.30.1" with binaries:
      - blitz
Done in 28.78s.
➜  blitz-projects node -v
v14.10.0
➜  blitz-projects 
➜  blitz-projects blitz -v
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

Linux 5.8 | linux-x64 | Node: v14.10.0

blitz: 0.30.1 (global)

  Package manager: npm 
  System:
    OS: Linux 5.8 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.99 GB / 31.01 GB
    Shell: 5.8 - /home/linuxbrew/.linuxbrew/bin/zsh
  Binaries:
    Node: 14.10.0 - ~/.nvm/versions/node/v14.10.0/bin/node
    Yarn: 1.22.5 - ~/.nvm/versions/node/v14.10.0/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.10.0/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found

➜  blitz-projects blitz new myApp
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

➜  blitz-projects ls
➜  blitz-projects ls -la
total 8
drwxrwxr-x  2 fredmaiaarantes fredmaiaarantes 4096 fev 19 11:02 .
drwxrwxr-x 16 fredmaiaarantes fredmaiaarantes 4096 fev 19 11:04 ..
flybayer commented 3 years ago

I wonder if it's an issue of yarn vs npm?

Can you go back to that node version, make sure blitz new fails, then try npx blitz new myapp and see if that works?

maxtheman commented 3 years ago

I can confirm having this same issue with npm node version 13.5.0 on mac osx. Error message shows up for me, but the solution is the same.

Error message on v13.5.0 for both blitz new and npx blitz new

(node:69998) [MODULE_NOT_FOUND] Error Plugin: @blitzjs/cli: No valid exports main found for '/Users/max/.nvm/versions/node/v13.5.0/lib/node_modules/blitz/node_modules/@blitzjs/generator/node_modules/diff' module: @oclif/config@1.17.0 task: toCached plugin: @blitzjs/cli root: /Users/max/.nvm/versions/node/v13.5.0/lib/node_modules/blitz/node_modules/@blitzjs/cli See more details with DEBUG=* (node:69998) [MODULE_NOT_FOUND] Error Plugin: @blitzjs/cli: No valid exports main found for '/Users/max/.nvm/versions/node/v13.5.0/lib/node_modules/blitz/node_modules/@blitzjs/generator/node_modules/diff' module: @oclif/config@1.17.0 task: toCached plugin: @blitzjs/cli root: /Users/max/.nvm/versions/node/v13.5.0/lib/node_modules/blitz/node_modules/@blitzjs/cli See more details with DEBUG=* › Warning: new is not a blitz command. Did you mean dev? [y/n]: n › Error: Run blitz help for a list of available commands.

Switching to node 12.18.3 resolves this issue.

Interestingly, blitz help shows that the new command does indeed not exist.

This is on a fresh blitz installation, I had been following the quickstart.

flybayer commented 3 years ago

This is the weirdest thing 🤔

fredmaiaarantes commented 3 years ago

I wonder if it's an issue of yarn vs npm?

Can you go back to that node version, make sure blitz new fails, then try npx blitz new myapp and see if that works?

Hey @flybayer, I just tried the steps you suggested and I got the same result using npx, it doesn't create the app.

➜  blitz-projects nvm version
v14.10.0
➜  blitz-projects blitz new myApp     
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

➜  blitz-projects ls -a
.  ..

➜  blitz-projects sudo blitz new myApp
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

You are using an unsupported version of Node.js. Please switch to v12 or newer.

➜  blitz-projects npx blitz new myApp
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

➜  blitz-projects ls -a
.  ..
➜  blitz-projects 
markhughes commented 3 years ago

@fredmaiaarantes is blitz new --dry-run myApp any different?

fredmaiaarantes commented 3 years ago

@fredmaiaarantes is blitz new --dry-run myApp any different?

No, it's not different.

➜  blit-projects nvm version
v14.10.0
➜  blit-projects blitz new --dry-run myApp
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

➜  blit-projects ls
➜  blit-projects ls -a
.  ..
flybayer commented 3 years ago

This was also reported by a macOS user: https://discord.com/channels/802917734999523368/814627638265643068/829705558147596358

markhughes commented 3 years ago

Is this possibly related to nvm? I've been trying to replicate it but I use volta.

markhughes commented 3 years ago

Actually.. replicated it:

$ volta install node@14.10.0
success: installed and set node@14.10.0 (with npm@6.14.8) as default
$ blitz new myappnode14100
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

$ node -v
v14.10.0

However, I resolved it by updating node:

$ volta install node@14.16.1
success: installed and set node@14.16.1 (with npm@6.14.12) as default
$ blitz new myappnode14161
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

✔ Pick a form library (you can switch to something else later if you want) · React Final Form

Hang tight while we set up your new Blitz app!

CREATE    .env
CREATE    .env.local
CREATE    .env.test.local
CREATE    .eslintrc.js
CREATE    .gitignore
CREATE    .npmrc
CREATE    .prettierignore
CREATE    README.md
CREATE    app/api/.keep
CREATE    app/auth/components/LoginForm.tsx
CREATE    app/auth/components/SignupForm.tsx
CREATE    app/auth/mutations/changePassword.ts
CREATE    app/auth/mutations/forgotPassword.test.ts
CREATE    app/auth/mutations/forgotPassword.ts
CREATE    app/auth/mutations/login.ts
CREATE    app/auth/mutations/logout.ts
CREATE    app/auth/mutations/resetPassword.test.ts
CREATE    app/auth/mutations/resetPassword.ts
CREATE    app/auth/mutations/signup.ts
CREATE    app/auth/pages/forgot-password.tsx
CREATE    app/auth/pages/login.tsx
CREATE    app/auth/pages/reset-password.tsx
CREATE    app/auth/pages/signup.tsx
CREATE    app/auth/validations.ts
CREATE    app/core/components/Form.tsx
CREATE    app/core/components/LabeledTextField.tsx
CREATE    app/core/hooks/useCurrentUser.ts
CREATE    app/core/layouts/Layout.tsx
CREATE    app/pages/404.tsx
CREATE    app/pages/_app.tsx
CREATE    app/pages/_document.tsx
CREATE    app/pages/index.test.tsx
CREATE    app/pages/index.tsx
CREATE    app/users/queries/getCurrentUser.ts
CREATE    babel.config.js
CREATE    blitz.config.js
CREATE    db/index.ts
CREATE    db/migrations/.keep
CREATE    db/schema.prisma
CREATE    db/seeds.ts
CREATE    integrations/.keep
CREATE    jest.config.js
CREATE    mailers/.keep
CREATE    mailers/forgotPasswordMailer.ts
CREATE    package.json
CREATE    public/favicon.ico
CREATE    public/logo.png
CREATE    test/setup.ts
CREATE    test/utils.tsx
CREATE    tsconfig.json
CREATE    types.d.ts
CREATE    types.ts

✔ Retrieving the freshest of dependencies
✔ Resolving packages
✔ Fetching packages
✔ Linking dependencies
✔ Building fresh packages
✔ Initializing SQLite database
✔ Committing your app

Your new Blitz app is ready! Next steps:

   1. cd myappnode14161
   2. blitz dev

$ node -v
v14.16.1
$ blitz -v
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

macOS Big Sur | darwin-x64 | Node: v14.16.1

blitz: 0.33.1 (global)

  Package manager: npm
  System:
    OS: macOS 11.2.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 768.87 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.1 - ~/.volta/tools/image/node/14.16.1/bin/node
    Yarn: 1.22.4 - ~/.volta/bin/yarn
    npm: 6.14.12 - ~/.volta/tools/image/node/14.16.1/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found
markhughes commented 3 years ago

I have tried to replicate it node 14.9:

(base)  ✘  ~/tmp  volta install node@14.9
success: installed and set node@14.9.0 (with npm@6.14.8) as default
(base)  ~/tmp  blitz new myappnode149
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

? Pick a form library (you can switch to something else later if you want) …
❯ React Final Form (recommended)
  React Hook Form

.. blah blah

and node 14.11

(base)  ✘  ~/tmp  volta install node@14.11.0
success: installed and set node@14.11.0 (with npm@6.14.8) as default
(base)  ~/tmp  blitz new myappnode140
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

✖ Pick a form library (you can switch to something else later if you want) ·

... blah blah

but they seem to work ok. The issues seems isolated to Node 14.10.

Digging further, the issue is resolved in 14.10.1:

(base)  ✘  ~/tmp  volta install node@14.10
success: installed and set node@14.10.1 (with npm@6.14.8) as default
(base)  ~/tmp  blitz new myappnode14101
You are using beta software - if you have any problems, please open an issue here:
      https://github.com/blitz-js/blitz/issues/new/choose

✔ Pick a form library (you can switch to something else later if you want) · React Final Form

Hang tight while we set up your new Blitz app!

CREATE    .env
CREATE    .env.local
CREATE    .env.test.local
CREATE    .eslintrc.js
CREATE    .gitignore

... blah blah 
(base)  ✘  ~/tmp  node --version
v14.10.1
flybayer commented 3 years ago

Awesome, thank you @markhughes!! We'll close this with that solution.

Solution

Upgrade to any version other than Node 14.10.0

markhughes commented 3 years ago

For reference, seems related to this: https://github.com/nodejs/node/commit/0f94c6b4e4 (the revert fixed the issue)