node 模块在用 yarn 安装包后没有安装

问题描述 投票:0回答:0

我正在使用 yarn 3.5.0。安装任何包后,我在项目根目录中看不到任何 node_modules 目录。问题是什么?是自然的吗?我收到类似未找到节点模块的错误。怎么解决??

我的步骤:

  1. yarn init -y
  2. yarn add <packages>
  3. yarn hardhat

结果文件和目录:

Hardhat 是我安装的包之一。

错误:

[{
    "resource": "/home/abinash/Desktop/Nft/onchain-allowlist/contracts/OnchainAllowlist.sol",
    "owner": "solidity-language-server",
    "code": "6275",
    "severity": 8,
    "message": "Source \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\" not found: File not found. Searched the following locations: \"\".",
    "source": "solidity",
    "startLineNumber": 4,
    "startColumn": 1,
    "endLineNumber": 4,
    "endColumn": 79
}]

因为没有node_modules。

node-modules yarnpkg
© www.soinside.com 2019 - 2024. All rights reserved.