starter-kit-tutorial icon indicating copy to clipboard operation
starter-kit-tutorial copied to clipboard

oz compile error: The filename, directory name, or volume label syntax is incorrect.

Open tab00 opened this issue 6 years ago • 12 comments

I'm using Windows 10.

I get the following output with errors after npm run start:

Compiled with warnings.

./src/components/Header/index.js Line 3: 'logo' is defined but never used no-unused-vars

./src/components/Footer/index.js Line 5: 'pencil' is defined but never used no-unused-vars

../contracts/Counter.sol Error: Command failed: 'C:\Users-\Documents\Projects\openzeppelin-starter-kit-tutorial\node_modules.bin\oz' compile The filename, directory name, or volume label syntax is incorrect.

../contracts/Wallet.sol Error: Command failed: 'C:\Users-\Documents\Projects\openzeppelin-starter-kit-tutorial\node_modules.bin\oz' compile The filename, directory name, or volume label syntax is incorrect.

Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before.

tab00 avatar Aug 05 '19 13:08 tab00

When I try oz compile in the main directory I get this output with errors:

× Compiling contracts with solc 0.5.10 (commit.5a6ea5b1) Compilation errors: @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol:4:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol" not found: File import callback not supported import "./ERC20Detailed.sol"; ^---------------------------^

@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol:5:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Mintable.sol" not found: File import callback not supported import "./ERC20Mintable.sol"; ^---------------------------^

@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/StandaloneERC20.sol:6:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Pausable.sol" not found: File import callback not supported import "./ERC20Pausable.sol"; ^---------------------------^

@openzeppelin\contracts-ethereum-package\contracts\access\roles\MinterRole.sol:4:1: ParserError: Source "Roles.sol" not found: File import callback not supported import "../Roles.sol"; ^--------------------^

@openzeppelin\contracts-ethereum-package\contracts\access\roles\PauserRole.sol:4:1: ParserError: Source "Roles.sol" not found: File import callback not supported import "../Roles.sol"; ^--------------------^

@openzeppelin\contracts-ethereum-package\contracts\lifecycle\Pausable.sol:4:1: ParserError: Source "access/roles/PauserRole.sol" not found: File import callback not supported import "../access/roles/PauserRole.sol"; ^--------------------------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20.sol:4:1: ParserError: Source "IERC20.sol" not found: File import callback not supported import "./IERC20.sol"; ^--------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20.sol:5:1: ParserError: Source "math/SafeMath.sol" not found: File import callback not supported import "../../math/SafeMath.sol"; ^-------------------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Detailed.sol:4:1: ParserError: Source "IERC20.sol" not found: File import callback not supported import "./IERC20.sol"; ^--------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Mintable.sol:4:1: ParserError: Source "ERC20.sol" not found: File import callback not supported import "./ERC20.sol"; ^-------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Mintable.sol:5:1: ParserError: Source "access/roles/MinterRole.sol" not found: File import callback not supported import "../../access/roles/MinterRole.sol"; ^-----------------------------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Pausable.sol:4:1: ParserError: Source "ERC20.sol" not found: File import callback not supported import "./ERC20.sol"; ^-------------------^

@openzeppelin\contracts-ethereum-package\contracts\token\ERC20\ERC20Pausable.sol:5:1: ParserError: Source "lifecycle/Pausable.sol" not found: File import callback not supported import "../../lifecycle/Pausable.sol"; ^------------------------------------^

tab00 avatar Aug 05 '19 13:08 tab00

Hey @tab00. It seems to be compiler related issue. Can you run truffle compile? Does it compiles fine? Also which version of truffle you use?

ylv-io avatar Aug 05 '19 19:08 ylv-io

I use [email protected] installed using npm -g.

Here's the output of truffle compile:

Compiling your contracts...=========================== C:\Users-.config\truffle\compilers\node_modules\soljson-v0.5.2+commit.1df8f40c.js:12 function Mua(a,c){a=a|0;c=c|0;var e=0,g=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,v=0,w=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,la=0,na=0,oa=0;e=u;u=u+272|0;f[a>>2]=0;f[a+4>>2]=0;f[a+8>>2]=0;a:do switch(f[c>>2]|0){case 1:{x=0;g=qa(811,c|0)|0;i=x;x=0;if(!(i&1)?(x=0,i=qa(814,g|0)|0,g=x,x=0,!(g&1)):0){if(!i){f[e+240+8>>2]=0;f[e+240+8+4>>2]=0;f[e+240+8+8>>2]=0;f[e+240+20>>2]=-1;f[e+240>>2]=28768;f[e+240+4>>2]=28792;f[e+196>>2]=0;f[e+196+4>>2]=0;f[e+196+8>>2]=0;x=0;i=qa(722,32)|0;g=x;x=0;if(!(g&1)){f[e+196>>2]=i;f[e+196+8>>2]=-2147483616;f[e+196+4>>2]=20;j=i;k=267487;l=j+20|0;do{b[j>>0]=b[k>>0]|0;j=j+1|0;k=k+1|0}while((j|0)<(l|0));b[i+20>>0]=0;f[e+208>>2]=13996;g=e+208+4|0;f[g>>2]=f[e+196>>2];f[g+4>>2]=f[e+196+4>>2];f[g+8>>2]=f[e+196+8>>2];f[e+196>>2]=0;f[e+196+4>>2]=0;f[e+196+8>>2]=0;x=0;m=Sa

SyntaxError: Unexpected end of input at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at VersionRange.getCachedSolcByFileName (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\loadingStrategies\VersionRange.js:37:1) at VersionRange.getCachedSolcByVersionRange (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\loadingStrategies\VersionRange.js:56:1) at VersionRange.load (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\loadingStrategies\VersionRange.js:192:1) at Promise (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\index.js:66:1) at new Promise () at CompilerSupplier.load (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\compilerSupplier\index.js:43:1) at findContracts.then.sourcePaths (C:\Users-\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-compile\profiler\index.js:93:1) Truffle v5.0.30 (core: 5.0.30) Node v10.16.1

tab00 avatar Aug 06 '19 05:08 tab00

Truffle's MetaCoin example at https://www.trufflesuite.com/docs/truffle/quickstart compiles fine for me.

tab00 avatar Aug 06 '19 05:08 tab00

I've just tried the Pet Shop tutorial at https://www.trufflesuite.com/tutorials/pet-shop and compilation works fine too.

tab00 avatar Aug 06 '19 07:08 tab00

I've tried you version and it works on linux machine. I'll try tomorrow on windows machine, don't have it at hand at that moment.

ylv-io avatar Aug 06 '19 21:08 ylv-io

How did it go in Windows?

tab00 avatar Aug 10 '19 14:08 tab00

I've just tried a fresh install again of this tutorial, and the same errors appeared.

tab00 avatar Aug 15 '19 11:08 tab00

Hey @tab00. Sorry for a delay. Can you verify that contracts are actually present at node_modules/@OpenZeppelin\contracts-ethereum-package\contracts\?

ylv-io avatar Aug 15 '19 22:08 ylv-io

Yes, they are all there.

tab00 avatar Aug 16 '19 11:08 tab00

How is the progress? I'd like to try the tutorial.

tab00 avatar Sep 03 '19 09:09 tab00

Hi @tab00,

One option would be to use Windows Subsystem for Linux: https://forum.openzeppelin.com/t/solidity-smart-contract-development-on-windows/2110

I am able to reproduce on native Windows and will need to investigate.

abcoathup avatar Jan 31 '20 08:01 abcoathup