mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
fix(cli): Init nodes dir to ensure npm install
succeeds (#3934)
Init nodes folder when created so npm doesnt fail
This commit is contained in:
parent
db02a379d9
commit
2d6eea82d3
|
@ -78,12 +78,6 @@ export const executeCommand = async (
|
|||
): Promise<string> => {
|
||||
const downloadFolder = UserSettings.getUserN8nFolderDowloadedNodesPath();
|
||||
|
||||
try {
|
||||
await fsAccess(downloadFolder);
|
||||
} catch (_) {
|
||||
await fsMkdir(downloadFolder);
|
||||
}
|
||||
|
||||
const execOptions = {
|
||||
cwd: downloadFolder,
|
||||
env: {
|
||||
|
@ -93,6 +87,15 @@ export const executeCommand = async (
|
|||
},
|
||||
};
|
||||
|
||||
try {
|
||||
await fsAccess(downloadFolder);
|
||||
} catch (_) {
|
||||
await fsMkdir(downloadFolder);
|
||||
// Also init the folder since some versions
|
||||
// of npm complain if the folder is empty
|
||||
await execAsync('npm init -y', execOptions);
|
||||
}
|
||||
|
||||
try {
|
||||
const commandResult = await execAsync(command, execOptions);
|
||||
|
||||
|
|
Loading…
Reference in a new issue