Getting Error: EEXIST: file already exists, mkdir '.'
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 349
- Avg merge
- 8m
- Merged PRs (30d)
- 1
Description
Hi:
I run this command: `solcjs --bin --include-path node_modules/ --base-path . LookupContract.sol`
And get this result:
```
Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
--> LookupContract.sol:9:1:
|
9 | constructor (string memory _name, uint _mobileNumber) public {
| ^ (Relevant source part starts here and spans across multiple lines).
fs.js:885
return binding.mkdir(pathModule._makeLong(path),
^
Error: EEXIST: file already exists, mkdir '.'
at Object.fs.mkdirSync (fs.js:885:18)
at Object. (/usr/local/lib/node_modules/solc/solc.js:232:4)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
```
Here is the content of `LookupContract.sol`:
```
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract LookupContract {
mapping (string => uint) public myDirectory;
constructor (string memory _name, uint _mobileNumber) public {
myDirectory[_name] = _mobileNumber;
}
function setMobileNumber(string memory _name, uint _mobileNumber) public {
myDirectory[_name] = _mobileNumber;
}
function getMobileNumber(string memory _name) public view returns (uint) {
return myDirectory[_name];
}
}
```
Here is my package.json
```
{
"name": "first-hedera-contract-js-sdk",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@hashgraph/cryptography": "^1.4.0",
"@hashgraph/sdk": "^2.18.0",
"dotenv": "^16.0.1",
"encoding": "^0.1.13",
"expo": "^45.0.8",
"expo-crypto": "^10.2.0",
"expo-random": "^12.3.0"
}
}
```
Help? I am jammed up.
Triple thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the reported command `solcjs --bin --include-path node_modules/ --base-path . LookupContract.sol` and inspect the stack trace at `/usr/local/lib/node_modules/solc/solc.js:232`. Determine why compilation attempts `mkdir '.'`; done means the cause and expected behavior are established, with a focused regression test if a code change is warranted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, solidity
- Domain
- cli, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100