Truffle: "truffle/Assert.sol" & "truffle/DeployedAddresses.sol" not found: File not supplied initially.

Created on 31 Jan 2018  路  9Comments  路  Source: trufflesuite/truffle

Issue

With truffle 4.0.5 on windows, test files fail to "import" with error:

'Error'
ParserError: Source "truffle/Assert.sol" not found: File not supplied initially.
import "truffle/Assert.sol";
ParserError: Source "truffle/DeployedAddresses.sol" not found: File not supplied initially.
import "truffle/DeployedAddresses.sol";

Steps to Reproduce

Created a test file and try to import truffle/Assert.sol and truffle/DeployedAddresses.sol

Expected Behavior

Test script should import scripts identified

Actual Results

Error not found: File not supplied initially.

Environment

Operating System: Windows 10
Visual Studio Code
Truffle version: 4.0.5
[email protected]
node version: 8.9.4
npm version:  5.6.0

Most helpful comment

From the windos command line (i.e. the gitbash command line) it didn't work for me (Windows 7). But it worked from the truffle develop command line
truffle develop
truffle(develop)> test
or
truffle(develop)> test ./test/TestMetacoin.sol
truffle(develop)> test ./test/metacoin.js

All 9 comments

truffle/Assert.sol and DeployedAddresses.sol files are missing for me also. I am following Truffle's metacoin example steps, at what stage these files should have been created. I noticed when test command showed 0 passing message. Didn't receive any error message till this point.

truffle(develop)> truffle test
Using network 'develop'.
0 passing (0ms)

@KurtLorey @malaravannm This issue has also been raised in #756. In that instance, the poster re-installed their project and the issue self-resolved. They were also on Windows using VS Code. If someone discovers why this is happening or if the steps suggested don't work please feel free to re-open or comment here.

Closing as duplicate of #756.

reinstalling project doesn't work.

same here... not working on windows 10 environment.

VS Code,
Windows10,
truffle 4.1.11
node 8.11.2
npm 5.6.2

is there any way to solve it?

what is mean by reinstalling the project ?
i deleted the project that i am working on ( pet-shop tutorial ) and cloned ( pet-shop-box ) and nothing changed.
and where should the global Truffle files be ?

It seems that this issue is related to naming conflict in Win env.
Try moving/renaming truffle.js in project root dir to truffle-config.js. This works for me.

Try to install truffle with -g option...

From the windos command line (i.e. the gitbash command line) it didn't work for me (Windows 7). But it worked from the truffle develop command line
truffle develop
truffle(develop)> test
or
truffle(develop)> test ./test/TestMetacoin.sol
truffle(develop)> test ./test/metacoin.js

From the windos command line (i.e. the gitbash command line) it didn't work for me (Windows 7). But it worked from the truffle develop command line
truffle develop
truffle(develop)> test
or
truffle(develop)> test ./test/TestMetacoin.sol
truffle(develop)> test ./test/metacoin.js

Thanks it worked over truffle(develop)>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arunmitteam picture arunmitteam  路  3Comments

mezrin picture mezrin  路  3Comments

bmmpxf picture bmmpxf  路  3Comments

timothywangdev picture timothywangdev  路  3Comments

abcoathup picture abcoathup  路  3Comments