Open roshan-sama opened 3 years ago
Next steps: check latest canary release.
0.40.0-canary.9 actually does not have this issue
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
@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
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>
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
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
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.
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 notPaste all your error logs here:
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:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response