nextui-org / nextui-cli

⌨️ A CLI tool that unlocks seamless NextUI integration.
MIT License
37 stars 14 forks source link

Command ` npx nextui-cli@latest` not work WSL #43

Closed sebastiandottop closed 4 months ago

sebastiandottop commented 4 months ago

NextUI CLI Version

I have not been able to install it

Describe the bug

I run the command npx nextui-cli@latest and it fires a node:internal

Steps to Reproduce the Bug or Issue

  1. Run npx nextui-cli@lates
  2. Download nextui-cli...
➜ ~  ✗ npx nextui-cli@latest
Need to install the following packages:
nextui-cli@0.1.5
Ok to proceed? (y) y
node:internal/modules/cjs/loader:1143
  const err = new Error(message);
              ^

Error: Cannot find module 'retry'
Require stack:
- /home/sebastian/.npm/_npx/8a2bbc96f792a803/node_modules/async-retry/lib/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/sebastian/.npm/_npx/8a2bbc96f792a803/node_modules/async-retry/lib/index.js:2:15)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at cjsLoader (node:internal/modules/esm/translators:366:17) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/sebastian/.npm/_npx/8a2bbc96f792a803/node_modules/async-retry/lib/index.js'
  ]
}

Node.js v20.12.2
➜ ~  ✗

Expected behavior

I was expecting an installation exit or asking if I want to install nextui-cli

Screenshots or Videos

image

image

Operating System Version

Windows with WSL

winchesHe commented 4 months ago

@castrogarciajs Hi, could you try global install? Like npm i -g nextui-cli and run nextui-cli

sebastiandottop commented 4 months ago

Yes, of course. But I not have a good result

Logs

image

Logs text

➜ ~  npm i -g nextui-cli

added 69 packages in 6s

26 packages are looking for funding
  run `npm fund` for details

➜ ~  nextui
nextui: command not found

➜ ~  ✗ nextui-cli
nextui-cli: command not found

➜ ~  ✗ next-ui --help
next-ui: command not found
winchesHe commented 4 months ago

I think this is a problem with the configuration of environment variables in WSL, you can try this solution

  1. Modify the configuration file for global environment variables: vim etc/profile (requires root privileges)

  2. Add the following content:

export NODE_HOME=/usr/app/node-v10.15.1-linux-x64 (change to your node path)
export PATH=$NODE_HOME/bin:$PATH
  1. Save and source /etc/profile
sebastiandottop commented 4 months ago

Thank you, It work