Skip to content

ERROR Invalid template name #4

@JT-Dev-215

Description

@JT-Dev-215

I get this error when I try to run the script for any template on a Windows environment.

trivin server -g -i
? Please choose which project template to use node-passport-jwt
ERROR Invalid template name

The error is caused by the the invalid path for templateDir in main.js line 55.

_const currentFileURL = import.meta.url;

import.meta.url gives the string 'file:///C:/...".

const templateDir = path.resolve(
new URL(currentFileURL).pathname,
'../../templates',
options.template.toLowerCase()
)

path.resolve() gives the string 'C:\C:...' causing the error. I had to remove the duplicate 'C:' to get the script to work.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions