Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

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

Closed
KurtLorey opened this issue Jan 31, 2018 · 15 comments

Comments

@KurtLorey
Copy link

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
ganache-cli@6.0.3
node version: 8.9.4
npm version:  5.6.0
@malaravannm
Copy link

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)

@cgewecke
Copy link
Contributor

@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.

@nukec
Copy link

nukec commented May 15, 2018

reinstalling project doesn't work.

@chainchaser
Copy link

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?

@lhbfahd
Copy link

lhbfahd commented Jul 26, 2018

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 ?

@ghost
Copy link

ghost commented Aug 12, 2018

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.

@sebastiankozub
Copy link

Try to install truffle with -g option...

@thomasoss
Copy link

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

@souravk9709
Copy link

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)>

@JamesEarle
Copy link

I am working through the Pet Shop tutorial and was having the same issue. Truffle's "magic" files that aren't anywhere in your repository were causing errors to show up in my tests, although the tests still ran and passed fine.

Try to install truffle with -g option...

Doing this with npm install truffle -g and restarting VS Code fixed the issue. Thanks @sebastiankozub

@ericnickus
Copy link

Its not a windows issue I don't think. It's happening on my imac with BigSur
Truffle v5.4.14 (core: 5.4.14)
Solidity v0.5.16 (solc-js)
Node v16.6.2
Web3.js v1.5.3

@ndrslmpk
Copy link

Same issue here on Windows 10.
Truffle v5.4.5 (core: 5.4.5)
Solidity - ^0.8.0 (solc-js)
Node v16.6.1
Web3.js v1.5.1

Isn't there a way to locally download the truffle folders?

@cds-amal
Copy link
Member

@ndrslmpk Can you open a new issue please? This will help us track and investigate the problem more efficiently. Thanks you!

@DigiCris
Copy link

DigiCris commented Jan 4, 2023

Also happening on my ubuntu and I can't find a way to fix it.

@cds-amal
Copy link
Member

cds-amal commented Jan 4, 2023

Hi @DigiCris, can you open a new issue for this, please? What version of truffle are you using, and, if possible, do you have a repo you can share? thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests