Trufffle Flattening on Windows and get Error: ENOENT: no such file or directory, open

When running truffle-flattener ./contracts/Bridge.sol > Falttened_Bridge.sol .
Getting error as Error: ENOENT: no such file or directory, open ‘c:/Users/raja%20roy/Desktop/XYZ-Bridge/token-bridge/bridge/contracts/zeppelin/token/ERC20/ERC20Detailed.sol’ .

Bridge,sol import a file

import “./zeppelin/token/ERC20/ERC20Detailed.sol”;

:1234: Code to reproduce


:computer: Environment

Truffle

It works with linux but not with windows

Seems to be a bug in the flattener (https://github.com/nomiclabs/truffle-flattener/issues/67, https://github.com/nomiclabs/truffle-flattener/issues/69).

Your path apparently includes a space the the flattener replaces it with %20, which is how spaces are usually handled in URLs but is not the right thing to do in local paths. Workaround - use a path without spaces.

1 Like

But the same config in windows worked for another project .

So how can i resolve it ?
Should i change path in solidity file when i am importing or i have to do any other thing ?