Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File name in templates not matching for typescript choice #3

Open
sonicdelay opened this issue May 14, 2020 · 0 comments
Open

File name in templates not matching for typescript choice #3

sonicdelay opened this issue May 14, 2020 · 0 comments

Comments

@sonicdelay
Copy link

sonicdelay commented May 14, 2020

Creating a backend fails with UnhandledPromiseRejectionWarning on Linux for typescript choise.

Error:

me@local:~/Downloads# npx create-backend
Create-Backend v3.8.3
What a beatiful day to write some beautiful code!
Let's begin

-github.com/ChoqueCastroLD
? What's your project name ? (This will be the project folder) backbone
? Would you like to use Aliases? Yes
? Should we include a User endpoint example? Yes
? Which database engine would you like to use? Postgres
? Would you like to use Typescript? Yes
? Which license would you like to use? UNLICENSED
(node:2239) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/create-backend/src/template/ts/src/controllers/user.ts'
    at Object.openSync (fs.js:458:3)
    at Object.readFileSync [as fileLoader] (fs.js:360:35)
    at fileLoader (/usr/local/lib/node_modules/create-backend/node_modules/ejs/lib/ejs.js:273:18)
    at handleCache (/usr/local/lib/node_modules/create-backend/node_modules/ejs/lib/ejs.js:213:16)
    at tryHandleCache (/usr/local/lib/node_modules/create-backend/node_modules/ejs/lib/ejs.js:254:16)
    at Object.exports.renderFile (/usr/local/lib/node_modules/create-backend/node_modules/ejs/lib/ejs.js:485:10)
    at renderFile (/usr/local/lib/node_modules/create-backend/src/generate.js:18:17)
    at Object.generate (/usr/local/lib/node_modules/create-backend/src/generate.js:65:13)
    at main (/usr/local/lib/node_modules/create-backend/src/index.js:67:33)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:2239) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:2239) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Local fix: Change filenames for the following files to:

  • /src/template/ts/src/models/User.ts -> users.ts ('s'?)
  • /src/template/ts/src/controllers/userController.ts -> user.ts
  • /src/template/ts/src/routes/userRoutes.ts -> user.ts

System:

  • OS: Linux MyNB 4.15.0-99-generic #100-Ubuntu SMP Wed Apr 22 20:32:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Hardware: Fujitsu Lifebook E780, Intel® Core™ i5 CPU M 520 @ 2.40GHz × 4, 8GB, 128SSD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant