I tried to compile my own smart contract by truffle compile. But instead of successful compile, a long list of error popped out. Initially I though that there was some mistake in my contract, so I tried compiling the default contracts we get during truffle init. Yet the same error popped up.
truffle init
truffle compile
Successful compilation with nothing in the output
ubuntu@vm1:~/truffleTest$ truffle compile
TypeError: this is not a typed array.
at Function.from (native)
at Object.files (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:155104:23)
at module.exports (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:36696:7)
at getFiles (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:46295:9)
at Object.module.exports.updated (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:46299:5)
at Function.xfs.mkdir.module.exports.compile.necessary (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:83411:12)
at Object.Contracts.compile (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:36773:15)
at Object.xfs.mkdir.module.exports.fs.lstat.fs.readdir.fs.writeFile.fs.exists.fs.link.fs.exists.fs.lstat.fs.exists.fs.rename.fs.link.fs.stat.ins.on.outs.on.methods.forEach.options.lstat.options.chmod.options.rmdir.options.readdir.fs.writeFile.fs.open.fs.futimes.fs.open.module.exports.module.exports.module.exports.module.exports.module.exports.command.run (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:200546:15)
at Command.xfs.mkdir.Command.run (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:60901:20)
at Object.
ubuntu@vm1:~/truffleTest$
I'm having the same error
I'm experiencing the same issue, with a very similar environment to the original poster:
Update your node to the newest version.
I just updated to 8.1.3 and it compiles fine!
For macOS just run: brew update && brew upgrade node && npm install -g npm
Unfortunately the Xenial repository is pretty old, so that would require compiling and installing node by hand, or finding a more up-to-date repository, and that could take a while.
However, I have a machine running Arch (current node version: 8.1.3) and can confirm that it seems to work OK with that version.
Edit: I found a node8 repository for ubuntu and upgraded.
Works now.
Hi there. This looks to be an isolated issue has been fixed (all the :+1:'s were on July 7th). I'm going to close this one for housekeeping. If you continue to run into this issue please open a new ticket and reference this one.
Here's what I get when running the above commands.
Cheers!
Most helpful comment
Update your node to the newest version.
I just updated to 8.1.3 and it compiles fine!
For macOS just run:
brew update && brew upgrade node && npm install -g npm