Closed fredmaiaarantes closed 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?
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.
This is the weirdest thing 🤔
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 trynpx 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
@fredmaiaarantes is blitz new --dry-run myApp
any different?
@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
. ..
This was also reported by a macOS user: https://discord.com/channels/802917734999523368/814627638265643068/829705558147596358
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
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
Awesome, thank you @markhughes!! We'll close this with that solution.
Upgrade to any version other than Node 14.10.0
For reference, seems related to this: https://github.com/nodejs/node/commit/0f94c6b4e4 (the revert fixed the issue)
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?
yarn global add blitz
blitz new myApp No folder is created, the project itself is not created and there are no error messages. I tried again using sudo.
sudo blitz new myApp. Got this error now: 'You are using an unsupported version of Node.js. Please switch to v12 or newer.'
nvm use v12.18.3
blitz new myApp
It works and the project is created.
Run
blitz -v
and paste the output here:This is my first opened issue so, let me know what can I do better next time.
All the steps are below: