blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

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

Open roshan-sama opened 3 years ago

roshan-sama commented 3 years ago

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.<anonymous> (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.<anonymous> (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

roshan-sama commented 3 years ago

Next steps: check latest canary release.

0.40.0-canary.9 actually does not have this issue

roshan-sama commented 3 years ago

I spoke too soon :( Came back home and tried to create a new project with blitz new (Fresh install. I did npm uninstall -g blitz, then deleted the .blitz folder from the AppData\Roaming\npm\node_modules folder), but I get this error now:

PS D:\QuickDocs> blitz new test
(node:8920) [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)

with DEBUG set to *

 @oclif/config loading plugins [
  '@oclif/plugin-help',
  '@oclif/plugin-not-found',
  '@oclif/plugin-autocomplete'
] +15ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\package.json +20ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\package.json +0ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\package.json +1ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\package.json +4ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\package.json +0ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\package.json +1ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\package.json +1ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\package.json +0ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\package.json +1ms
  @oclif/config reading core plugin C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found +0ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\package.json +2ms
  @oclif/config reading core plugin C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-help +0ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-help\package.json +2ms
  @oclif/config reading core plugin C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-autocomplete +0ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-autocomplete\package.json +1ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\oclif.manifest.json +1ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-help\oclif.manifest.json +1ms
  @oclif/config loadJSON C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-autocomplete\oclif.manifest.json +1ms
  @oclif/config:@oclif/plugin-not-found using manifest from C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-help using manifest from C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-help\oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-autocomplete using manifest from C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-autocomplete\oclif.manifest.json +0ms
  @oclif/config config done +25ms
  @oclif/config start init hook +1ms
  blitz:@blitzjs/cli:hooks:init start C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\check-before-running +0ms
  blitz:@blitzjs/cli:hooks:init done +6ms
  @oclif/config init hook done +8ms
  blitz init version: @oclif/command@1.8.0 argv: [ 'new', 'test' ] +0ms
  @oclif/config runCommand new [ 'test' ] +5ms
  @oclif/config start command_not_found hook +1ms
  blitz:@oclif/plugin-not-found:hooks:command_not_found start C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\lib +0ms
Warning: new is not a blitz command.
    at Object.warn (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\errors\lib\index.js:49:15)
    at Object.warn (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:136:30)
    at Object.hook (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\lib\index.js:25:10)
    at async C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:151:21
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async Config.runHook (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:161:9)
    at async Config.runCommand (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:168:13)
    at async Main.run (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\command\lib\main.js:27:9)
    at async Main._run (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\command\lib\command.js:43:20)
Did you mean dev? [y/n]:
  blitz:@oclif/plugin-not-found:hooks:command_not_found Error: Prompt timeout
  blitz:@oclif/plugin-not-found:hooks:command_not_found     at Timeout._onTimeout (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\node_modules\cli-ux\lib\prompt.js:91:24)
  blitz:@oclif/plugin-not-found:hooks:command_not_found     at listOnTimeout (node:internal/timers:556:17)
  blitz:@oclif/plugin-not-found:hooks:command_not_found     at processTimers (node:internal/timers:499:7) +5s
Error: Run blitz help for a list of available commands.
    at Object.error (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\errors\lib\index.js:26:15)
    at Object.error (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:133:30)
    at Object.hook (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\plugin-not-found\lib\index.js:39:10)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:151:21
    at async Promise.all (index 0)
    at async Promise.all (index 1)
    at async Config.runHook (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:161:9)
    at async Config.runCommand (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\config\lib\config.js:168:13)
    at async Main.run (C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@oclif\command\lib\main.js:27:9)
  lazy-require saving type cache to C:\Users\Roshan\AppData\Roaming\npm\node_modules\blitz\node_modules\@blitzjs\cli\lib\src\.blitzjs-cli-cache +6s
  lazy-require no changes to save +0ms
PS D:\QuickDocs> blitz -v
Windows 10 | win32-x64 | Node: v15.8.0

blitz: 0.40.0-canary.9 (global)

  Package manager: npm
  System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 AMD Ryzen 7 2700 Eight-Core Processor
    Memory: 8.33 GB / 15.93 GB
  Binaries:
    Node: 15.8.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.24.1 - 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
flybayer commented 3 years ago

@Roesh Cannot find module 'next/dist/server/lib/logging' indicates that the next package inside your global node_modules is corrupted.

Try deleting blitz (not just .blitz), @blitzjs, and next from your global node_modules

roshan-sama commented 3 years ago

Oh, so I'm looking at my global node_modules and I don't actually see a next folder or @blitzjs folder, I have a .blitz folder and a blitz folder.

Though I'd confirm again, so I uninstalled blitz with npm uninstall -g blitz, and the global node_modules looked like this:

PS C:\Users\Roshan\AppData\Roaming\npm\node_modules> ls

    Directory: C:\Users\Roshan\AppData\Roaming\npm\node_modules

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         8/27/2021   1:01 PM                @angular
d-----          3/5/2021   5:50 PM                @preconstruct
d-----          7/7/2021  11:23 AM                expo
d-----         7/24/2021   2:16 AM                expo-cli
d-----         7/30/2021   7:24 PM                node
d-----        11/28/2020   5:20 PM                node-gyp
d-----         3/30/2021   5:22 PM                npkill
d-----         9/29/2021   9:33 PM                npm
d-----         2/14/2021   4:46 PM                npm-windows-upgrade
d-----          3/9/2021   7:58 PM                prettier
d-----          2/2/2021   7:17 PM                pwabuilder
d-----         7/10/2021   6:39 AM                redis-cli
d-----          3/8/2021   2:55 PM                typescript
d-----         7/30/2021   7:24 PM                yarn

PS C:\Users\Roshan\AppData\Roaming\npm\node_modules> ls -h
PS C:\Users\Roshan\AppData\Roaming\npm\node_modules>

After installation of blitz@0.40.0, I have the following folders, but still no next or @blitzjs folder:

PS C:\Users\Roshan\AppData\Roaming\npm\node_modules> ls

    Directory: C:\Users\Roshan\AppData\Roaming\npm\node_modules

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         10/3/2021   1:00 AM                .blitz
d-----         8/27/2021   1:01 PM                @angular
d-----          3/5/2021   5:50 PM                @preconstruct
d-----         10/3/2021  12:59 AM                blitz
d-----          7/7/2021  11:23 AM                expo
d-----         7/24/2021   2:16 AM                expo-cli
d-----         7/30/2021   7:24 PM                node
d-----        11/28/2020   5:20 PM                node-gyp
d-----         3/30/2021   5:22 PM                npkill
d-----         9/29/2021   9:33 PM                npm
d-----         2/14/2021   4:46 PM                npm-windows-upgrade
d-----          3/9/2021   7:58 PM                prettier
d-----          2/2/2021   7:17 PM                pwabuilder
d-----         7/10/2021   6:39 AM                redis-cli
d-----          3/8/2021   2:55 PM                typescript
d-----         7/30/2021   7:24 PM                yarn

PS C:\Users\Roshan\AppData\Roaming\npm\node_modules> ls -h
PS C:\Users\Roshan\AppData\Roaming\npm\node_modules>

I'm really curious why some versions work then though. I'm able to keep upgrading and downgrading blitz versions until I hit a release where blitz -v stops working. I started with 0.33.1 which worked, switched to 0.37.0 which also worked, then 0.38.3 which didn't work, 0.38.3-canary.0 worked, 0.38.3-canary.1 which didn't work

I'm sure there's likely a release between 0.39.0 and 0.40.0 where blitz -v starts working but the errors with blitz new start occurring, but haven't tested which transition it occurs in.

I don't know too much about how npm on Windows differs from npm on linux so I'm having a hard time knowing where to start troubleshooting.

To make sure, I downgraded to 0.33.1 again, and looked at the folder structure, sure enough, no next or @blitzjs folders:

PS D:\QuickDocs> 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: v15.8.0

blitz: 0.33.1 (global)

  Package manager: npm
  System:
    OS: Windows 10 10.0.19042
    CPU: (16) x64 AMD Ryzen 7 2700 Eight-Core Processor
    Memory: 7.78 GB / 15.93 GB
  Binaries:
    Node: 15.8.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.24.1 - 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\Roshan\AppData\Roaming\npm\node_modules> ls

    Directory: C:\Users\Roshan\AppData\Roaming\npm\node_modules

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         10/3/2021   1:00 AM                .blitz
d-----         8/27/2021   1:01 PM                @angular
d-----          3/5/2021   5:50 PM                @preconstruct
d-----         10/3/2021   1:06 AM                blitz
d-----          7/7/2021  11:23 AM                expo
d-----         7/24/2021   2:16 AM                expo-cli
d-----         7/30/2021   7:24 PM                node
d-----        11/28/2020   5:20 PM                node-gyp
d-----         3/30/2021   5:22 PM                npkill
d-----         9/29/2021   9:33 PM                npm
d-----         2/14/2021   4:46 PM                npm-windows-upgrade
d-----          3/9/2021   7:58 PM                prettier
d-----          2/2/2021   7:17 PM                pwabuilder
d-----         7/10/2021   6:39 AM                redis-cli
d-----          3/8/2021   2:55 PM                typescript
d-----         7/30/2021   7:24 PM                yarn

PS C:\Users\Roshan\AppData\Roaming\npm\node_modules> ls -h
PS C:\Users\Roshan\AppData\Roaming\npm\node_modules>
flybayer commented 3 years ago

Ok, so @blitzjs probably lives under node_modules/blitz/. Package managers keep changing where nested packages actually live. But either way, that should be fine.

Real issue here is missing next package which should be installed because it's set as a dependency of @blitzjs/core using an npm alias. However sometimes npm is broken and doesn't install that correctly, so we have postinstall script to patch it. But seems this is failing now too.

Maybe we can fix the postinstall script for now.

Beyond that, this should totally go away with coming monorepo refactor where we remove the current blitz package and rename current next package to blitz

beerose commented 3 years ago

Looks like it's not just on windows. Here's the same issue happening on mac os: https://github.com/blitz-js/legacy-framework/issues/229

tetchel commented 3 years ago

I had this same issue on Fedora after running yarn global add blitz and yarn global add next.

I worked around it by using npm instead.