blitz-js / blitz-js/legacy-framework

`blitz new` doesn't work - Cannot find module 'next/dist/server/lib/logging'

Open
#23 7 comments 1 reaction 1 assignee Claimed by @flybayer View on GitHub
kind/bug legacy-framework needs investigation status/assigned
Dominant language
JavaScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

After installing the latest blitz version using `npm i -g blitz@latest`, there is an error preventing running any global blitz commands.

This occurred with my Windows PC. I removed blitz and reinstalled it via npm (deleting the .blitz folder beforehand), but still had the same issue. I then tried to do the same on my laptop and ran into the same issue.

## v0.40.0-canary.9
The blitz -v command works, but the `blitz new xyz` command does not

### Paste all your error logs here:
```
(node:18300) [MODULE_NOT_FOUND] Error Plugin: @blitzjs/cli: Cannot find module 'next/dist/server/lib/logging'
Require stack:
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\commands\db.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\plugin.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\index.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\command\lib\command.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\command\lib\index.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\index.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\cli\dist\blitz-cli.cjs.dev.js
- C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\cli\dist\blitz-cli.cjs.js
module: @oclif/config@1.17.0
task: toCached
plugin: @blitzjs/cli
root: C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
```
Full version in comment https://github.com/blitz-js/legacy-framework/issues/23

## 0.39.0 Issues

blitz -v does not work

### Paste all your error logs here:

```
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\manue> 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

Windows 10 | win32-x64 | Node: v12.18.3

blitz: 0.33.1 (global)

Package manager: npm
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 7.37 GB / 13.92 GB
Binaries:
Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.6.3 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
npmPackages:
@prisma/client: Not Found
blitz: Not Found
prisma: Not Found
react: Not Found
react-dom: Not Found
typescript: Not Found

PS C:\Users\manue> npm i -g blitz@latest
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.2
npm WARN node_modules/blitz/node_modules/react
npm WARN peer react@"*" from @testing-library/react@11.2.5
npm WARN node_modules/blitz/node_modules/@testing-library/react
npm WARN @testing-library/react@"11.2.5" from blitz@0.39.0
npm WARN node_modules/blitz
npm WARN 2 more (react-dom, @testing-library/react-hooks)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"17.0.1" from react-test-renderer@17.0.1
npm WARN node_modules/blitz/node_modules/react-test-renderer
npm WARN react-test-renderer@"17.0.1" from blitz@0.39.0
npm WARN node_modules/blitz
npm WARN 1 more (@testing-library/react-hooks)
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
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 sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
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.

added 317 packages, removed 197 packages, changed 1363 packages, and audited 1681 packages in 2m

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

7 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 7.6.3 -> 7.24.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.24.1
npm notice Run npm install -g npm@7.24.1 to update!
npm notice
PS C:\Users\manue> blitz -v
Error: Cannot find module 'next/dist/next-server/server/config-shared'
Require stack:
- C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\index.js
- C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\cli\dist\blitz-cli.cjs.dev.js
- C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\cli\dist\blitz-cli.cjs.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Module._load (internal/modules/cjs/loader.js:841:27)
at Function._load (C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\node_modules\@salesforce\lazy-require\lib\LazyLoader.js:99:24)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\index.js:10:25)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\manue\\AppData\\Roaming\\npm\\node_modules\\blitz\\node_modules\\@blitzjs\\cli\\lib\\src\\index.js',
'C:\\Users\\manue\\AppData\\Roaming\\npm\\node_modules\\blitz\\cli\\dist\\blitz-cli.cjs.dev.js',
'C:\\Users\\manue\\AppData\\Roaming\\npm\\node_modules\\blitz\\cli\\dist\\blitz-cli.cjs.js'
]
}
PS C:\Users\manue> npm i -g blitz@0.33.1
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.2
... ... ...
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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

changed 1802 packages, and audited 1803 packages in 2m

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

10 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
npm audit fix --force

Run `npm audit` for details.
PS C:\Users\manue> 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

Windows 10 | win32-x64 | Node: v12.18.3

blitz: 0.33.1 (global)

Package manager: npm
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 6.88 GB / 13.92 GB
Binaries:
Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.6.3 - C:\Program Files\nodejs\npm.CMD
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: 0.33.1 (global)

Package manager: npm
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Memory: 6.88 GB / 13.92 GB
Binaries:
Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.6.3 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
npmPackages:
@prisma/client: Not Found
blitz: Not Found
prisma: Not Found
react: Not Found
react-dom: Not Found
typescript: Not Found
```

### Paste all relevant code snippets here:

```
PASTE_HERE (leave the ``` marks)
```

### What are detailed steps to reproduce this?

1. On Windows, upgrade to the latest blitz version
2. Try to use any blitz commands

### Run `blitz -v` and paste the output here:

```
Error: Cannot find module 'next/dist/next-server/server/config-shared'
Require stack:
- C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\index.js
- C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\cli\dist\blitz-cli.cjs.dev.js
- C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\cli\dist\blitz-cli.cjs.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Module._load (internal/modules/cjs/loader.js:841:27)
at Function._load (C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\node_modules\@salesforce\lazy-require\lib\LazyLoader.js:99:24)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Users\manue\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\index.js:10:25)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\manue\\AppData\\Roaming\\npm\\node_modules\\blitz\\node_modules\\@blitzjs\\cli\\lib\\src\\index.js',
'C:\\Users\\manue\\AppData\\Roaming\\npm\\node_modules\\blitz\\cli\\dist\\blitz-cli.cjs.dev.js',
'C:\\Users\\manue\\AppData\\Roaming\\npm\\node_modules\\blitz\\cli\\dist\\blitz-cli.cjs.js'
]
}
```

### Please include below any other applicable logs and screenshots that show your problem:

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.