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

Error when trying to import hono #43

Open
ernestoresende opened this issue Oct 23, 2023 · 9 comments
Open

Error when trying to import hono #43

ernestoresende opened this issue Oct 23, 2023 · 9 comments
Labels
question Further information is requested

Comments

@ernestoresende
Copy link
Member

ernestoresende commented Oct 23, 2023

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 #18 (comment)

@ernestoresende ernestoresende added the question Further information is requested label Oct 23, 2023
@ernestoresende
Copy link
Member Author

ernestoresende commented Oct 23, 2023

@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
Copy link

CalebeBirer commented Oct 24, 2023

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
Copy link
Member Author

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
Copy link

CalebeBirer commented Oct 24, 2023

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/[email protected]/node_modules/es5-ext: Running postinstall script, done in 63ms
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 89ms
node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, done in 95ms
node_modules/.pnpm/[email protected]/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
Copy link

CalebeBirer commented Oct 25, 2023

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

> [email protected] 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/[email protected] 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
Copy link
Member Author

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
Copy link

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

@CalebeBirer
Copy link

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
Copy link
Member Author

ernestoresende commented Nov 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants