Skip to content

Windowsでzenn initが落ちる #596

@marudedameo2019

Description

@marudedameo2019

OS: Windows 11 Home 24H2(26100.6899)(64 ビット オペレーティング システム、x64 ベース プロセッサ)
node.js version: v22.21.1
shell: git bash(C:\Program Files\git\bin\bash.exe)5.2.37(x86_64-pc-msys)

以下の手順でzenn-cliのインストールをしたのですが、zenn initがnodeの例外で落ちてしまいました。何かWindowsだと必要な手順があるのでしょうか?

C:\>mkdir zenn-cli-example

C:\>cd zenn-cli-example

C:\zenn-cli-example>node --version
v22.21.1

C:\zenn-cli-example>npm init -y
Wrote to C:\zenn-cli-example\package.json:

{
  "name": "zenn-cli-example",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}




C:\zenn-cli-example>npm i zenn-cli@latest

added 1 package, and audited 2 packages in 2s

found 0 vulnerabilities

C:\zenn-cli-example>npx zenn init
node:internal/url:1489
    throw new ERR_INVALID_FILE_URL_PATH('must be absolute', url);
    ^

TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute
    at getPathFromURLWin32 (node:internal/url:1489:11)
    at fileURLToPath (node:internal/url:1613:35)
    at C:\zenn-cli-example\node_modules\zenn-cli\dist\server\zenn.js:272:1660
    at C:\zenn-cli-example\node_modules\zenn-cli\dist\server\zenn.js:293:2027
    at Object.<anonymous> (C:\zenn-cli-example\node_modules\zenn-cli\dist\server\zenn.js:293:2031)
    at Module._compile (node:internal/modules/cjs/loader:1706:14)
    at Object..js (node:internal/modules/cjs/loader:1839:10)
    at Module.load (node:internal/modules/cjs/loader:1441:32)
    at Function._load (node:internal/modules/cjs/loader:1263:12)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14) {
  code: 'ERR_INVALID_FILE_URL_PATH',
  input: file:///home/runner/work/zenn-editor/zenn-editor/node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
}

Node.js v22.21.1

C:\zenn-cli-example>npm config get script-shell
C:\Program Files\git\bin\bash.exe

C:\zenn-cli-example>"C:\Program Files\Git\bin\bash.exe" --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-msys)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

C:\zenn-cli-example>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions