thtsystems / open-visit

Open-source application for visiting scheduling.
MIT License
9 stars 6 forks source link

Error when trying to import hono #43

Open ernestoresende opened 11 months ago

ernestoresende commented 11 months ago

hello can you help me with this error when import hono

calebebirer@calebebirer:~/Project_CBB$ npm create hono@latest my-app
Need to install the following packages:
  create-hono@latest
Ok to proceed? (y) y
internal/modules/cjs/loader.js:818
  throw err;
  ^
Error: Cannot find module 'node:http'
Require stack:
- /home/calebebirer/.npm/_npx/6bbb1d6f54609fb5/node_modules/create-hono/bin
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/calebebirer/.npm/_npx/6bbb1d6f54609fb5/node_modules/create-hono/bin:21719:33)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/calebebirer/.npm/_npx/6bbb1d6f54609fb5/node_modules/create-hono/bin'
  ]
}
npm ERR! code 1
npm ERR! path /home/calebebirer/Project_CBB
npm ERR! command failed
npm ERR! command sh -c create-hono "my-app"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/calebebirer/.npm/_logs/2023-10-20T16_08_23_542Z-debug-0.log

Originally posted by @CalebeMito in https://github.com/thtsystems/open-visit/discussions/18#discussioncomment-7341028

ernestoresende commented 11 months ago

@CalebeMito it seems like you're trying to create/bootstrap a new application with Hono's CLI utility for creating new apps (declared when you used npm create).

There is no need to create new applications. I recommend that you take a look at the contribution guide from the repo in order to understand how to setup the development environment step-by-step.

Let me know trough this issue if you have further related issues.

CalebeBirer commented 11 months ago

hello thanks, I understand, now I have a problem installing npm

root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB# node --version
v18.18.2
root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB#    pnpm install
 ERR_PNPM_NO_PKG_MANIFEST  No package.json found in /home/calebe/Project_CBB
root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB# npm install        
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/calebe/Project_CBB/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/calebe/Project_CBB/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-23T18_58_42_762Z-debug-0.log
root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB# npm i
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/calebe/Project_CBB/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/calebe/Project_CBB/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-23T18_59_25_817Z-debug-0.log

can you help me please?
ernestoresende commented 11 months ago
root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB# pnpm install
 ERR_PNPM_NO_PKG_MANIFEST  No package.json found in /home/calebe/Project_CBB

This means that the package.json that should be at the root of the project is not present. Make sure you're in the correct directory, and that you have properly cloned the project locally. An exact copy of this package.json should be present on the root directory of your project.

CalebeBirer commented 11 months ago

thank you very much!!!!!!

calebe@calebe-Nitro-AN515-57:~/Project_CBB/open-visit$ sudo pnpm install
[sudo] senha para calebe: 
Scope: all 4 workspace projects
Lockfile is up to date, resolution step is skipped
Packages: +449
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 WARN  GET https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz error (EACCES). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz error (EACCES). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz error (EACCES). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz error (EACCES). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/split2/-/split2-4.2.0.tgz error (EACCES). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz error (EACCES). Will retry in 10 seconds. 2 retries left.
Downloading registry.npmjs.org/next/13.5.4: 16,80 MB/16,80 MB, done
Downloading registry.npmjs.org/@next/swc-linux-x64-musl/13.5.4: 44,34 MB/44,34 MB, done
Downloading registry.npmjs.org/@next/swc-linux-x64-gnu/13.5.4: 38,00 MB/38,00 MB, done
Downloading registry.npmjs.org/typescript/5.2.2: 7,23 MB/7,23 MB, done
Downloading registry.npmjs.org/turbo-linux-64/1.10.16: 19,81 MB/19,81 MB, done
Downloading registry.npmjs.org/@cloudflare/workerd-linux-64/1.20231016.0: 26,26 MB/26,26 MB, done
 WARN  GET https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz error (EACCES). Will retry in 1 minute. 1 retries left.
Progress: resolved 449, reused 0, downloaded 449, added 449, done
node_modules/.pnpm/es5-ext@0.10.62/node_modules/es5-ext: Running postinstall script, done in 63ms
node_modules/.pnpm/esbuild@0.17.19/node_modules/esbuild: Running postinstall script, done in 89ms
node_modules/.pnpm/esbuild@0.18.20/node_modules/esbuild: Running postinstall script, done in 95ms
node_modules/.pnpm/workerd@1.20231016.0/node_modules/workerd: Running postinstall script, done in 129ms

dependencies:
+ prettier 3.0.3
+ turbo 1.10.16
+ typescript 5.2.2
+ wrangler 3.14.0

Done in 2m 17.8s
CalebeBirer commented 11 months ago

hello @ernestoresende you can help me again please

i am can`t make push for my pgadmin, I don't know if it sets the correct password for postgree, how can I check?

root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB/open-visit# pnpm db:push

> open-visit@1.0.0 db:push /home/calebe/Project_CBB/open-visit
> turbo db:push

• Packages in scope: @open-visit/api, @open-visit/database, web
• Running db:push in 3 packages
• Remote caching disabled
@open-visit/database:db:push: cache bypass, force executing 389f9c38ec04853e
@open-visit/database:db:push: 
@open-visit/database:db:push: > @open-visit/database@1.0.0 db:push /home/calebe/Project_CBB/open-visit/database
@open-visit/database:db:push: > pnpm dotenv drizzle-kit push:pg
@open-visit/database:db:push: 
@open-visit/database:db:push: drizzle-kit: v0.19.13
@open-visit/database:db:push: drizzle-orm: v0.28.6
@open-visit/database:db:push: 
@open-visit/database:db:push: No config path provided, using default path
@open-visit/database:db:push: Reading config file '/home/calebe/Project_CBB/open-visit/database/drizzle.config.ts'
@open-visit/database:db:push:  Invalid input  Either "connectionString" or "host", "database" are required for database connection
@open-visit/database:db:push:  ELIFECYCLE  Command failed with exit code 1.
@open-visit/database:db:push: ERROR: command finished with error: command (/home/calebe/Project_CBB/open-visit/database) pnpm run db:push exited (1)
@open-visit/database#db:push: command (/home/calebe/Project_CBB/open-visit/database) pnpm run db:push exited (1)

 Tasks:    0 successful, 1 total
Cached:    0 cached, 1 total
  Time:    950ms 
Failed:    @open-visit/database#db:push

 ERROR  run failed: command  exited (1)
 ELIFECYCLE  Command failed with exit code 1.
ernestoresende commented 11 months ago

Clone the provided .env.example from the database directory to a local .env file:

cd database
cp .env.example .env

Try running the command again and it should properly push the schema to the database if it's correctly setup within the Docker container

CalebeBirer commented 11 months ago

can you give me a tip on how to do git pull and update in my location?

CalebeBirer commented 11 months ago

see the errors, It seems that my SSH key is not registered

root@calebe-Nitro-AN515-57:/home/calebe/Project_CBB/open-visit# git pull https://github.com/thtsystems/open-visit.git main From https://github.com/thtsystems/open-visit

ernestoresende commented 11 months ago

You seem to have messed up your SSH settings, which is unrelated to the repository cloning itself. The SSH keyring is only an authorization method by which you're telling the remote (eg.: Github), who you are, and it in turn will tell you if you have the necessary permissions to manipulate a repo.

Note that you won't be able to use SSH authentication to clone the repository from this remote, because from Github's perspective, you're not a member of the organization, but an outside collaborator. You will be able to clone through HTTPS, but trying to push directly to a branch in this remote will fail.

The recommended workflow is to:

  1. Fork the repository to your GitHub user;
  2. Clone the repository from that fork;
  3. Submit a PR pointing from your fork to our remote;

That way, you won't be prevented from pushing changes, as the remote will be your personal fork, not the organization repo.

Let me know if Git operations are being too big of a roadblock for you or other collaborators, as this may signal that I'll have to write up a guide or open some after-hours session focusing on Git/GitHub collaboration workflow.