You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
difficulty: starterIssues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.
~/Desktop $ mkdir test~/Desktop $ cdtest~/D/test $ npx @docusaurus/init@next init ./ classic
npx: installed 59 in 12.719s
Error: Directory already exists at /Users/alexander/Desktop/test !
at /Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/lib/index.js:72:19
at Generator.next (<anonymous>)
at /Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/lib/index.js:13:71
at new Promise (<anonymous>)
at __awaiter (/Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/lib/index.js:9:12)
at init (/Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/lib/index.js:48:12)
at /Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/bin/index.js:31:5
at Command.<anonymous> (/Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/bin/index.js:45:22)
at Command.listener (/Users/alexander/.npm/_npx/45284/lib/node_modules/@docusaurus/init/node_modules/commander/index.js:315:8)
at Command.emit (events.js:203:13)
Reacted by Debargha Roy, Mike Solomon and Morgan Marshall
I don't think @asvetly was confused about how to invoke the command. By the text he wrote, it seems clear he was trying to tell Docusaurus to use the current directory (./) as the base directory for the site, which is understandable since clearly Docusaurus by default takes the [name] parameter and creates a directory with that name. He was trying to reuse a directory that was already created — similar to how mkdir foo; cd foo; git init = git init foo. Unfortunately, this doesn't seem to be possible with Docusaurus.
(And for those curious, using the [rootDir] parameter does not allow this either; it just allows for specifing a path, other than the current directory, where to create the [name] directory.)
Reacted by Nathan Agez, Debargha Roy, Wang Luning, Mike Solomon and Ian Chen
difficulty: starterIssues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.
Activity
gimdongwoo commentedon Sep 10, 2019
You executed the wrong command.
Correct command parameter is below.
npx @docusaurus/init@next init [name] [template]or
npx @docusaurus/init@next init [name] [template] [rootDir]waldyrious commentedon Aug 18, 2021
I don't think @asvetly was confused about how to invoke the command. By the text he wrote, it seems clear he was trying to tell Docusaurus to use the current directory (
./) as the base directory for the site, which is understandable since clearly Docusaurus by default takes the[name]parameter and creates a directory with that name. He was trying to reuse a directory that was already created — similar to howmkdir foo; cd foo; git init=git init foo. Unfortunately, this doesn't seem to be possible with Docusaurus.(And for those curious, using the
[rootDir]parameter does not allow this either; it just allows for specifing a path, other than the current directory, where to create the[name]directory.)nathanagez commentedon Oct 12, 2021
@endiliey you should re-open this issue I think.