Closed regardt-nel closed 3 years ago
Do you only have Blitz installed globally? Not locally? (i.e. npm install blitz --save
instead of npm install blitz --global
)
Hi @sam3d I only installed it globally as per the documentation. When I proceed to create a new Blitz project I get an error when I run the first migrate command - blitzjs/server not found
. This lead me to check blitz -v
to see if everything installed properly.
@regardt-nel the "not found" from blitz -v
is expected, those only show when running that command inside an app.
Did you try removing blitz and installing again? (could be a fluke)
The other thing you can try is npm i -g blitz@canary
. Perhaps the issue is already fixed.
HI @flybayer thanks for the suggestion. Installation ran perfectly. The app started up perfectly with blitz dev
.
When I ran blitz generate all project name:string
I got the following output ->
@regardt-nel can you (1) paste the output of blitz -v
and (2) paste the contents of node_modules/next/package.json
?
Package.json ->
PS C:\Projects\TodoToday> cat .\package.json
{
"name": "TodoToday",
"version": "1.0.0",
"scripts": {
"dev": "blitz dev",
"build": "blitz build",
"start": "blitz start",
"studio": "blitz prisma studio",
"lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
"test": "jest",
"test:watch": "jest --watch",
"prepare": "husky install"
},
"prisma": {
"schema": "db/schema.prisma"
},
"prettier": {
"semi": false,
"printWidth": 100
},
"lint-staged": {
"*.{js,ts,tsx}": [
"eslint --fix"
]
},
"dependencies": {
"@prisma/client": "2.30.2",
"blitz": "0.40.0-canary.7",
"react-dom": "alpha",
"react": "alpha",
"zod": "3.8.1",
"final-form": "4.20.2",
"react-final-form": "6.5.3"
},
"devDependencies": {
"@types/preview-email": "2.0.1",
"@types/react": "17.0.19",
"eslint": "7.32.0",
"husky": "6.0.0",
"lint-staged": "10.5.4",
"prettier-plugin-prisma": "0.15.0",
"prettier": "2.3.2",
"pretty-quick": "3.1.1",
"preview-email": "3.0.5",
"prisma": "2.30.2",
"typescript": "~4.3"
},
"private": true
}
blitz -v ->
PS C:\Projects\TodoToday> blitz -v
Windows 10 | win32-x64 | Node: v12.13.0
blitz: 0.40.0-canary.7 (global)
blitz: 0.40.0-canary.7 (local)
Package manager: yarn
System:
OS: Windows 10 10.0.19042
CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
Memory: 1.87 GB / 7.95 GB
Binaries:
Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
npmPackages:
@prisma/client: 2.30.2 => 2.30.2
blitz: 0.40.0-canary.7 => 0.40.0-canary.7
prisma: 2.30.2 => 2.30.2
react: alpha => 18.0.0-alpha-46a0f050a-20210828
react-dom: alpha => 18.0.0-alpha-46a0f050a-20210828
typescript: ~4.3 => 4.3.5
Thanks @regardt-nel, but I need the contents of node_modules/next/package.json
, not your app package.json
Sorry @flybayer ! Here you go ->
PS C:\Projects\TodoToday\node_modules\next> cat .\package.json
{
"name": "@blitzjs/next",
"version": "11.1.0-0.40.0-canary.7",
"nextjsVersion": "11.1.0",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
"repository": "vercel/next.js",
"bugs": "https://github.com/vercel/next.js/issues",
"homepage": "https://nextjs.org",
"types": "types/index.d.ts",
"files": [
"dist",
"app.js",
"app.d.ts",
"babel.js",
"babel.d.ts",
"client.js",
"client.d.ts",
"config.js",
"config.d.ts",
"constants.js",
"constants.d.ts",
"data.js",
"data.d.ts",
"data-client.js",
"data-client.d.ts",
"document.js",
"document.d.ts",
"dynamic.js",
"dynamic.d.ts",
"error.js",
"error.d.ts",
"script.js",
"script.d.ts",
"head.js",
"head.d.ts",
"image.js",
"image.d.ts",
"link.js",
"link.d.ts",
"router.js",
"router.d.ts",
"amp.js",
"amp.d.ts",
"stdlib.js",
"stdlib.d.ts",
"stdlib-server.js",
"stdlib-server.d.ts",
"types/index.d.ts",
"types/utils.ts",
"types/global.d.ts",
"image-types/global.d.ts"
],
"bin": {
"next": "./dist/bin/next"
},
"scripts": {
"dev": "taskr",
"release": "taskr release",
"prepublish": "npm run release && yarn types",
"types": "rimraf \"dist/**/*.d.ts\" && tsc --declaration --emitDeclarationOnly --declarationDir dist",
"typescript": "tsc --noEmit --declaration",
"ncc-compiled": "ncc cache clean && taskr ncc",
"build-native": "napi build --platform --release --cargo-cwd build/swc native"
},
"taskr": {
"requires": [
"./taskfile-ncc.js",
"./taskfile-swc.js"
]
},
"dependencies": {
"@babel/helper-module-imports": "^7.0.0",
"@babel/runtime": "7.12.5",
"@hapi/accept": "5.0.2",
"@next/env": "11.1.0",
"@next/polyfill-module": "11.1.0",
"@next/react-dev-overlay": "11.1.0",
"@next/react-refresh-utils": "11.1.0",
"@node-rs/helper": "1.2.1",
"@types/secure-password": "3.1.0",
"assert": "2.0.0",
"ast-types": "0.13.2",
"b64-lite": "^1.4.0",
"bad-behavior": "^1.0.1",
"browserify-zlib": "0.2.0",
"browserslist": "4.16.6",
"buffer": "5.6.0",
"caniuse-lite": "^1.0.30001228",
"chalk": "2.4.2",
"chokidar": "3.5.1",
"constants-browserify": "1.0.0",
"cookie-session": "^1.4.0",
"crypto-browserify": "3.12.0",
"cssnano-simple": "3.0.0",
"debug": "4.3.1",
"domain-browser": "4.19.0",
"encoding": "0.1.13",
"esbuild": "^0.11.12",
"etag": "1.8.1",
"fs-extra": "^9.1.0",
"get-orientation": "1.1.2",
"https-browserify": "1.0.0",
"image-size": "1.0.0",
"jest-worker": "27.0.0-next.5",
"native-url": "0.3.4",
"node-fetch": "2.6.1",
"node-html-parser": "1.4.9",
"node-libs-browser": "^2.2.1",
"null-loader": "4.0.1",
"os-browserify": "0.3.0",
"p-limit": "3.1.0",
"passport": "0.4.1",
"path-browserify": "1.0.1",
"pnp-webpack-plugin": "1.6.4",
"postcss": "8.2.15",
"process": "0.11.10",
"querystring-es3": "0.2.1",
"raw-body": "2.4.1",
"react-is": "17.0.2",
"react-query": "3.16.0",
"react-refresh": "0.8.3",
"resolve-from": "^5.0.0",
"secure-password": "4.0.0",
"stream-browserify": "3.0.0",
"stream-http": "3.1.1",
"string_decoder": "1.3.0",
"styled-jsx": "4.0.0",
"superjson": "1.7.2",
"timers-browserify": "2.0.12",
"tslog": "^3.1.1",
"tty-browserify": "0.0.1",
"use-subscription": "1.5.1",
"util": "0.12.3",
"vm-browserify": "1.1.2",
"watchpack": "2.1.1"
},
"peerDependencies": {
"fibers": ">= 3.1.0",
"node-sass": "^4.0.0 || ^5.0.0",
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
"node-sass": {
"optional": true
},
"sass": {
"optional": true
},
"fibers": {
"optional": true
}
},
"devDependencies": {
"@ampproject/toolbox-optimizer": "2.7.1-alpha.0",
"@babel/code-frame": "7.12.11",
"@babel/core": "7.12.10",
"@babel/generator": "^7.12.10",
"@babel/plugin-proposal-class-properties": "7.12.1",
"@babel/plugin-proposal-export-namespace-from": "7.12.1",
"@babel/plugin-proposal-numeric-separator": "7.12.7",
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
"@babel/plugin-syntax-bigint": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-jsx": "7.12.1",
"@babel/plugin-transform-modules-commonjs": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.10",
"@babel/preset-env": "7.12.11",
"@babel/preset-react": "7.12.10",
"@babel/preset-typescript": "7.12.7",
"@babel/traverse": "^7.12.10",
"@babel/types": "7.12.12",
"@napi-rs/cli": "1.1.0",
"@next/polyfill-nomodule": "11.1.0",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
"@types/amphtml-validator": "1.0.0",
"@types/babel__code-frame": "7.0.2",
"@types/babel__core": "7.1.12",
"@types/babel__generator": "7.6.2",
"@types/babel__template": "7.4.0",
"@types/babel__traverse": "7.11.0",
"@types/ci-info": "2.0.0",
"@types/compression": "0.0.36",
"@types/content-type": "1.1.3",
"@types/cookie": "0.3.3",
"@types/cross-spawn": "6.0.2",
"@types/debug": "4.1.5",
"@types/etag": "1.8.0",
"@types/fresh": "0.5.0",
"@types/jsonwebtoken": "8.5.0",
"@types/lodash.curry": "4.1.6",
"@types/lru-cache": "5.1.0",
"@types/node-fetch": "2.5.8",
"@types/path-to-regexp": "1.7.0",
"@types/react": "17.0.2",
"@types/react-dom": "16.9.4",
"@types/react-is": "16.7.1",
"@types/semver": "7.3.1",
"@types/send": "0.14.4",
"@types/styled-jsx": "2.2.8",
"@types/text-table": "0.2.1",
"@types/webpack": "5.28.0",
"@types/webpack-sources": "0.1.5",
"@vercel/ncc": "0.27.0",
"amphtml-validator": "1.0.33",
"arg": "4.1.0",
"async-retry": "1.2.3",
"async-sema": "3.0.1",
"babel-plugin-dynamic-import-node": "2.3.3",
"babel-plugin-transform-define": "2.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"bfj": "7.0.2",
"cacache": "15.0.5",
"ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
"cli-select": "1.1.2",
"comment-json": "3.0.3",
"compression": "1.7.4",
"conf": "5.0.0",
"content-type": "1.0.4",
"cookie": "0.4.1",
"cross-spawn": "7.0.3",
"css-loader": "4.3.0",
"devalue": "2.0.1",
"escape-string-regexp": "2.0.0",
"file-loader": "6.0.0",
"find-cache-dir": "3.3.1",
"find-up": "4.1.0",
"fresh": "0.5.2",
"gzip-size": "5.1.1",
"http-proxy": "1.18.1",
"ignore-loader": "0.1.2",
"is-docker": "2.0.0",
"is-wsl": "2.2.0",
"json5": "2.2.0",
"jsonwebtoken": "8.5.1",
"loader-utils": "2.0.0",
"lodash.curry": "4.1.1",
"lru-cache": "5.1.1",
"mini-css-extract-plugin": "1.5.0",
"nanoid": "^3.1.20",
"neo-async": "2.6.1",
"ora": "^5.3.0",
"path-to-regexp": "6.1.0",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-loader": "4.3.0",
"postcss-preset-env": "6.7.0",
"postcss-scss": "3.0.5",
"recast": "0.18.5",
"resolve-url-loader": "3.1.2",
"sass-loader": "10.0.5",
"schema-utils": "2.7.1",
"semver": "7.3.4",
"send": "0.17.1",
"source-map": "0.6.1",
"string-hash": "1.1.3",
"strip-ansi": "6.0.0",
"taskr": "1.1.0",
"terser": "5.7.1",
"text-table": "0.2.0",
"typescript": "4.4.2",
"unistore": "3.4.1",
"web-vitals": "2.1.0",
"webpack": "4.44.1",
"webpack-sources": "1.4.3"
},
"engines": {
"node": ">=12.0.0"
},
"napi": {
"name": "next-swc",
"triples": {
"defaults": true
}
},
"gitHead": "5c219f1e6068df8bcacc8feb68e8a51eb5cfcee3",
"blitzVersion": "0.40.0-canary.7"
}
Closing in favor of https://github.com/blitz-js/blitz/issues/2727
What is the problem?
Installed Blitz.js with recommended npm command but when I run
blitz -v
it shows that nothing is installed.Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Install Blitz with
npm install -g blitz
running Node 12.13Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
PS C:\Users\regar> npm i -g blitz npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added C:\Program Files\nodejs\blitz -> C:\Program Files\nodejs\node_modules\blitz\bin\blitz
internal/modules/cjs/loader.js:797 throw err; ^
Error: Cannot find module 'react' Require stack:
C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\next\dist\pages_app.js
C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\next\app.js
C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\@blitzjs\core\app\dist\blitzjs-core-app.cjs.dev.js
C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\@blitzjs\core\app\dist\blitzjs-core-app.cjs.js
C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\dist\blitz.cjs.dev.js
C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\dist\blitz.cjs.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15) at Function.Module._load (internal/modules/cjs/loader.js:687:27) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\next\dist\pages_app.js:1:178)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:849:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\next\dist\pages\_app.js',
'C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\next\app.js',
'C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\@blitzjs\core\app\dist\blitzjs-core-app.cjs.dev.js',
'C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\node_modules\@blitzjs\core\app\dist\blitzjs-core-app.cjs.js',
'C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\dist\blitz.cjs.dev.js',
'C:\Users\regar\AppData\Roaming\nvm\v12.13.0\node_modules\blitz\dist\blitz.cjs.js'
]
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules\blitz\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @testing-library/react@11.2.5 requires a peer of react@ but none is installed. You must install peer dependencies yourself.
npm WARN @testing-library/react@11.2.5 requires a peer of react-dom@ but none is installed. You must install peer dependencies yourself.
npm WARN @testing-library/react-hooks@4.0.1 requires a peer of react@>=16.9.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-test-renderer@17.0.1 requires a peer of react@17.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ts-jest@26.5.0 requires a peer of typescript@>=3.8 <5.0 but none is installed. You must install peer dependencies yourself.
npm WARN babel-plugin-superjson-next@0.3.0 requires a peer of next@>=9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ts-node@9.1.1 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
npm WARN null-loader@4.0.1 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-query@3.16.0 requires a peer of react@^16.8.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @blitzjs/next@11.0.1-0.39.0 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN @blitzjs/next@11.0.1-0.39.0 requires a peer of node-sass@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @blitzjs/next@11.0.1-0.39.0 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN @next/react-dev-overlay@11.0.1 requires a peer of react@^17.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN @next/react-dev-overlay@11.0.1 requires a peer of react-dom@^17.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN @next/react-refresh-utils@11.0.1 requires a peer of webpack@^4 || ^5 but none is installed. You must install peer dependencies yourself.
npm WARN styled-jsx@3.3.2 requires a peer of react@15.x.x || 16.x.x || 17.x.x but none is installed. You must install peer dependencies yourself.
npm WARN use-subscription@1.5.1 requires a peer of react@^16.8.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jscodeshift@0.11.0 requires a peer of @babel/preset-env@^7.1.6 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/eslint-plugin@4.17.0 requires a peer of eslint@^5.0.0 || ^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-next@11.1.0 requires a peer of eslint@^7.23.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-next@11.1.0 requires a peer of next@>=10.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-next@11.1.0 requires a peer of typescript@>=3.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of 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 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/experimental-utils@4.17.0 requires a peer of eslint@ but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react@7.25.1 requires a peer of eslint@^3 || ^4 || ^5 || ^6 || ^7 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-import@2.24.2 requires a peer of eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jsx-a11y@6.4.1 requires a peer of eslint@^3 || ^4 || ^5 || ^6 || ^7 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react-hooks@4.2.0 requires a peer of eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @typescript-eslint/parser@4.29.3 requires a peer of eslint@^5.0.0 || ^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-import-resolver-typescript@2.4.0 requires a peer of eslint@ but none is installed. You must install peer dependencies yourself.
npm WARN jsdom@16.7.0 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.5.4 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.5.4 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN react-shallow-renderer@16.14.1 requires a peer of react@^16.0.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
blitz@0.39.0 updated 1 package in 369.607s