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
Can you try this in plain old nodejs? shell.cd() is supposed to work for basically any folder—as long as you have permission to enter that folder, shell.cd() should handle it.
Node version (or tell us if you're using electron or some other framework):
Using Nuxt 3 - node version v21.6.2
ShellJS version (the most recent version/Github branch you see the bug on):
0.8.5
Operating system:
Mac OS 14.4.1 (23E224) (Sonoma)
Description of the bug:
I'm trying to cd to the home directory (using 'os' library) and list the data (ls -l) and i get this error:
ERROR cd: not a directory: /Users/razor
and the ls -l command is executed on the project folder.
is possible to cd to another folder outside the project?
Example ShellJS command to reproduce the error:
import os from "os";
import shell from "shelljs";
const homedir = os.homedir();
const listarArchivosDeCarpeta = async () => {
shell.cd(homedir);
shell.exec("ls -l");
}
export default defineEventHandler(async (event) => {
await listarArchivosDeCarpeta();
})
The text was updated successfully, but these errors were encountered: