Error When Compiling Contracts
See original GitHub issueIssue
I type this command in the directory of my contract: truffle compile
And I get this error:
C:\Users\nick\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\cli.js:93
let removedInfo = new RegExp(identifyingInfo, "g");
^
SyntaxError: Invalid regular expression: /C:\Users\nick\AppData\Roaming\npm\node_modules\/: \ at end of pattern
at new RegExp (<anonymous>)
at Object.<anonymous> (C:\Users\nick\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-core\cli.js:93:1)
at cb (util.js:353:39)
at callbackifyOnRejected (util.js:337:10)
at process._tickCallback (internal/process/next_tick.js:63:19)
What do I do to fix this?
Expected Behavior
I expect the command to compile my contracts.
Environment
Truffle v5.0.7 (core: 5.0.7) Solidity - 0.5.5 (solc-js) Node v10.15.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (8 by maintainers)
Top Results From Across the Web
Errors when compiling smart contracts with Truffle and solc-js
This post has to do with troubleshooting Truffle and solc-js errors using npm. The first issue I encountered involved an error regarding an...
Read more >Parsing error when compiling with Solidity - Stack Overflow
I'm trying to compile 2 chainlink references ...
Read more >Compiling contract raises strange error from solc but ... - GitHub
It stems from a limitation of the EVM (only 16 stack slots are reachable at any given time) and working around it requires...
Read more >solidity - Error when compiling - Ethereum Stack Exchange
I'm using the latest version of Truffle. When I try to compile my contract I get this error.
Read more >Compiling Contracts — Brownie v1.3.1 documentation
When doing so, you may encounter compiler errors when a contract imports another contract that is meant to compile on a higher version....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@PizBernina @mudgen I have fixed this, it should be live in our next release. @mudgen’s fix should take care of it in the short term. Thank you for bringing this to our attention!
@PizBernina, the reason you saw this happen in a different command is because the regex error only throws inside of another error. So you likely had an error in your migration somewhere. Once the regex is fixed you’ll be able to see what the actual error was.
This issue is fixed as of v5.0.8. Closing, thank you for finding and reporting it!