Import ERC721 and Counters Files import callback not supported

In Token.sol file I get message under the:

import "..node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "..node_modules/@openzeppelin/contracts/utils/Counters.sol";

that:

Source "..node_modules/@openzeppelin/contracts/utils/Counters.sol" not found: File import callback not supported

And if I try to compile I get in Terminal this Compilation failed error

C:\Users\PC\Desktop\Tokens\Rarible clone\contracts>truffle migrate --reset

Compiling your contracts...
===========================
√ Fetching solc version list from solc-bin. Attempt #1
> Compiling .\contracts\Migrations.sol
> Compiling .\contracts\NftExpoTestToken.sol
√ Fetching solc version list from solc-bin. Attempt #1

ParserError: Source "..node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: 
File import callback not supported
 --> /C/Users/PC/Desktop/Tokens/Rarible clone/contracts/contracts/NftExpoTestToken.sol:4:1:     
  |
4 | import '..node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol';
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

,ParserError: Source "..node_modules/@openzeppelin/contracts/utils/Counters.sol" not found: File import callback not supported
 --> /C/Users/PC/Desktop/Tokens/Rarible clone/contracts/contracts/NftExpoTestToken.sol:5:1:
  |
5 | import '..node_modules/@openzeppelin/contracts/utils/Counters.sol';
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compilation failed. See above.
Truffle v5.3.4 (core: 5.3.4)
Node v12.20.2

try removing the ..node_modules/ from the front of the import, this should not be needed.

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

Another thing to be aware of is if you’re using solidity version 0.7.x or 0.6.x then the correct version of Openzeppelin is 3.4.0. Only use the latest version of Openzeppelin if using solidity 0.8.x.

Thanks for the answer. I removed the ..node_modules/ .

I use solidity ^0.8.0; version and @openzeppelin/[email protected] version then I staretd tutorial I installed everything from scrach.
Still not working.

Do you have ideas what else I can try?

You can always peek at the repo here:

The repo has the ../node_modules/ though it is not required (and should be removed). I was able to compile the version in the repo both with and without node_modules in the path.

Is the error message you’re getting the same? It’s difficult to debug without detailed error messages and seeing your code.