PatrickAlphaC / hardhat-smartcontract-lottery-fcc

MIT License
118 stars 181 forks source link

yarn hardhat: not creating new project #193

Open Sammycoderr opened 12 months ago

Sammycoderr commented 12 months ago

upon starting a new project, yarn add --dev hardhat doesn't create the node_modules and package.json files (it says it found it in the project)... how can I find a fix please?

also, after typing yarn hardhat to give the prompt to create a new hardhat project (along side the hardhat.config.js etc), it gives somethign like this instead:


warning ../../package.json: No license field
$ /home/sammy/hh-fcc/hardhat-smartcontract-raffle-fcc/node_modules/.bin/hardhat
Hardhat version 2.17.1

Usage: hardhat [GLOBAL OPTIONS] <TASK> [TASK OPTIONS]

GLOBAL OPTIONS:

  --config              A Hardhat config file. 
  --emoji               Use emoji in messages. 
  --flamegraph          Generate a flamegraph of your Hardhat tasks 
  --help                Shows this message, or a task's help if its name is provided 
  --max-memory          The maximum amount of memory that Hardhat can use. 
  --network             The network to connect to. 
  --show-stack-traces   Show stack traces (always enabled on CI servers). 
  --tsconfig            A TypeScript config file. 
  --typecheck           Enable TypeScript type-checking of your scripts/tests 
  --verbose             Enables Hardhat verbose logging 
  --version             Shows hardhat's version. 

AVAILABLE TASKS:

  check                 Check whatever you need
  clean                 Clears the cache and deletes all artifacts
  compile               Compiles the entire project, building all artifacts
  console               Opens a hardhat console
  coverage              Generates a code coverage report for tests
  deploy                Deploy contracts
  etherscan-verify      submit contract source code to etherscan
  export                export contract deployment of the specified network into one file
  export-artifacts  
  flatten               Flattens and prints contracts and their dependencies. If no file is passed, all the contracts in the project will be flattened.
  gas-reporter:merge
  help                  Prints this message
  node                  Starts a JSON-RPC server on top of Hardhat EVM
  run                   Runs a user-defined script after compiling the project
  size-contracts        Output the size of compiled contracts
  sourcify              submit contract source code to sourcify (https://sourcify.dev)
  test                  Runs mocha tests
  verify                Verifies contract on Etherscan

To get help for a specific task run: npx hardhat help [task]```
vookami commented 10 months ago

maybe try yarn init which will create package.json file and tryyarn add --dev hardhat to get a yar.lock file, and yarn hardhat to get hardhat.config.js file. hope this wrok for you!