yabuki
yabuki3mo ago

Deno with Storybook:Do I need to install node.js? (need npx)

Hello there. I'd like to install storybook with deno 2.0.0-rc.7 on Debian GNU/Linux stable.
$ deno run -A --node-modules-dir=auto npm:storybook@latest init
/bin/sh: 1: npx: not found
$ deno run -A --node-modules-dir=auto npm:storybook@latest init
/bin/sh: 1: npx: not found
Do I need to install npx? (node.js) or Deno way?
1 Reply
yabuki
yabukiOP3mo ago
humm... hardcoded.
$ rg npx .
./dist/proxy.js
5:var args=process.argv.slice(2);if(["dev","build"].includes(args[0]))__require("@storybook/core/cli/bin");else {let command=["npx","--yes",...args[0]==="init"?[`create-storybook@${versions.storybook}`,...args.slice(1)]:[`@storybook/cli@${versions.storybook}`,...args]];spawn(command[0],command.slice(1),{stdio:"inherit",shell:!0}).on("exit",code=>{code!=null&&process.exit(code),process.exit(1);});}

./dist/proxy.cjs
1:"use strict";var import_common=require("@storybook/core/common"),import_child_process=require("child_process"),args=process.argv.slice(2);if(["dev","build"].includes(args[0]))require("@storybook/core/cli/bin");else{let command=["npx","--yes",...args[0]==="init"?[`create-storybook@${import_common.versions.storybook}`,...args.slice(1)]:[`@storybook/cli@${import_common.versions.storybook}`,...args]];(0,import_child_process.spawn)(command[0],command.slice(1),{stdio:"inherit",shell:!0}).on("exit",code=>{code!=null&&process.exit(code),process.exit(1)})}
$ rg npx .
./dist/proxy.js
5:var args=process.argv.slice(2);if(["dev","build"].includes(args[0]))__require("@storybook/core/cli/bin");else {let command=["npx","--yes",...args[0]==="init"?[`create-storybook@${versions.storybook}`,...args.slice(1)]:[`@storybook/cli@${versions.storybook}`,...args]];spawn(command[0],command.slice(1),{stdio:"inherit",shell:!0}).on("exit",code=>{code!=null&&process.exit(code),process.exit(1);});}

./dist/proxy.cjs
1:"use strict";var import_common=require("@storybook/core/common"),import_child_process=require("child_process"),args=process.argv.slice(2);if(["dev","build"].includes(args[0]))require("@storybook/core/cli/bin");else{let command=["npx","--yes",...args[0]==="init"?[`create-storybook@${import_common.versions.storybook}`,...args.slice(1)]:[`@storybook/cli@${import_common.versions.storybook}`,...args]];(0,import_child_process.spawn)(command[0],command.slice(1),{stdio:"inherit",shell:!0}).on("exit",code=>{code!=null&&process.exit(code),process.exit(1)})}
Another try
$ deno run -A --node-modules-dir=auto npm:create-storybook
Error: Unable to find a usable package manager within NPM, PNPM, Yarn and Yarn 2
at Function.getPackageManager (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/@storybook+core@8.3.4/node_modules/@storybook/core/dist/common/index.cjs:143260:11)
at doInitiate (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:85:947)
at file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:119:337
at withTelemetry (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/@storybook+core@8.3.4/node_modules/@storybook/core/dist/core-server/index.cjs:47080:18)
at initiate (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:119:255)
at Command.<anonymous> (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:120:2077)
at Command.listener [as _actionHandler] (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:542:17)
at file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:1502:14
at Command._chainOrCall (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:1386:12)
at Command._parseCommand (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:1501:27)
$ deno run -A --node-modules-dir=auto npm:create-storybook
Error: Unable to find a usable package manager within NPM, PNPM, Yarn and Yarn 2
at Function.getPackageManager (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/@storybook+core@8.3.4/node_modules/@storybook/core/dist/common/index.cjs:143260:11)
at doInitiate (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:85:947)
at file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:119:337
at withTelemetry (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/@storybook+core@8.3.4/node_modules/@storybook/core/dist/core-server/index.cjs:47080:18)
at initiate (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:119:255)
at Command.<anonymous> (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/create-storybook@8.3.4/node_modules/create-storybook/dist/bin/index.cjs:120:2077)
at Command.listener [as _actionHandler] (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:542:17)
at file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:1502:14
at Command._chainOrCall (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:1386:12)
at Command._parseCommand (file:///home/yabuki/src/etude-sb/first/node_modules/.deno/commander@12.1.0/node_modules/commander/lib/command.js:1501:27)
humm need to install package manager apt install npm then deno add npm:storybook@latest , deno install -A --global . That way is installed storybook.
$ deno install -A --global npm:storybook@latest
✅ Successfully installed storybook
/home/yabuki/.deno/bin/storybook
$ deno install -A --global npm:storybook@latest
✅ Successfully installed storybook
/home/yabuki/.deno/bin/storybook
$ storybook info

Storybook Environment Info:

System:
OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 18.19.0 - /usr/bin/node
npm: 9.2.0 - /usr/bin/npm <----- active
$ storybook info

Storybook Environment Info:

System:
OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 18.19.0 - /usr/bin/node
npm: 9.2.0 - /usr/bin/npm <----- active