λ truffle serve
Serving static assets in .build on port 8080...
C:UsersCatAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:119780
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (C:UsersCatAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:119780:11)
at setFSEventsListener (C:UsersCatAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:119834:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (C:UsersCatAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:119998:16)
at FSWatcher.
at gotStat (fs.js:1737:21)
at FSReqWrap.oncomplete (fs.js:114:15)
Had the same problem with truffle@beta. After having installed [email protected] the problem disappeared. However, for a successful install of [email protected] you must have a VS2015 build chain. I know it doesn't sound like a real solution but according to this thread it's rather hard to run truffle properly under Windows.
On a Windows machine. Can confirm that I am also having the problem with the latest truffle (release v3.3.0) when running truffle serve. Installed [email protected] which resolves this issue (thanks brakmic).
I'm a bit tempted to buy a MacBook just to develop on Truffle....
Just had this Same issue resolved with installing [email protected]
it's not a windows10 issue, as i was running ubuntu 16.04
@tcoulter
Same issue on MacOS
Same issue on Ubuntu 16.04 - [email protected], workaround I found to use:
npm run dev
Confirmed issue with Truffle 3.3.0. We're on it.
@EdgarCloggs
I don't understand the npm run dev workaround?
After running:
truffle init
truffle compile
truffle migrate
there is no package.json there. So no script to run?
Would you know where I can get the package.json for the truffled project?
can confirm happening windows 10 v3.4.4
Is there any known workaround for the time being? Ubuntu 14.04 here.
Edit: The workaround npm run dev works with such a setup: https://github.com/trufflesuite/truffle-init-webpack
npm run dev works with truffle 3.3.1 on Mac
same here at macOS 10.12.5
$ truffle version
Truffle v3.4.5 (core: 3.4.5)
npm run dev works though.
same here
macOS 10.12.5
Truffle v3.4.5 (core: 3.4.5)
Same with Truffle v3.2.8 on Mac OS 10.12.5 Sierra
Any fix to come ?
Same with truffle 3.4.5 on Mac 10.12.5 Sierra
Node Version: 7.6
npm version: 4.1.2
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/Users/ron/.nvm/versions/node/v7.6.0/lib/node_modules/truffle/build/cli.bundled.js:124978:11)
at setFSEventsListener (/Users/ron/.nvm/versions/node/v7.6.0/lib/node_modules/truffle/build/cli.bundled.js:125032:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/Users/ron/.nvm/versions/node/v7.6.0/lib/node_modules/truffle/build/cli.bundled.js:125196:16)
at FSWatcher.
at gotStat (fs.js:1723:21)
at FSReqWrap.oncomplete (fs.js:114:15)
Hey guys,
Same with truffle 3.4.6 on Ubuntu 16.04.
Any fix in the near future?
Or, how can I downgrade my truffle version to a working one?
Edit: Ok, I used npm install -g [email protected] and this seems to work fine.
Same problem on MacOS with truffle 3.4.8
I had a similar issue and this is what fixed it for me was to re-initialize a new truffle instance with "truffle init webpack" :
``
➜ truffle> truffle serve
Serving static assets in ./build on port 8080...
/Users/thfalgou/.nvm/versions/node/v6.6.0/lib/node_modules/truffle/build/cli.bundled.js:115605
return (new fsevents(path)).on('fsevent', callback).start();
^
➜ truffle> cd ..
➜ ethereum> mkdir truffle-webpack
➜ ethereum> cd truffle-webpack
➜ truffle-webpack> truffle init webpack
Usingtruffle initwith a specific template is deprecated. Please usetruffle unbox` instead.
...
➜ truffle-webpack> truffle compile
Compiling ./contracts/ConvertLib.sol...
...
➜ truffle-webpack> truffle migrate
Using network 'development'.
...
➜ truffle-webpack> npm run dev
[email protected] dev /Users/thfalgou/tmp/ethereum/truffle-webpack
webpack-dev-server
Project is running at http://localhost:8080/
I also had similar issue.old version is fine."npm run dev" only can run Boxes DApp,like these.http://truffleframework.com/boxes/
I also had the same issue. MacOs
Truffle v3.4.8
node.js v6.11.2
I also had the same issue. MacOs
Truffle v3.4.7 (core: 3.4.7)
Solidity v0.4.13 (solc-js)
I also had the same issue. Truffle v3.4.9
Same issue with Truffle v3.4.9 on Arch Linux:
$ truffle version
Truffle v3.4.9 (core: 3.4.8)
Solidity v0.4.15 (solc-js)
$ truffle init
...
$ truffle compile
...
$ truffle migrate
...
$ truffle serve
Serving static assets in ./build on port 8080...
/usr/lib/node_modules/truffle/build/cli.bundled.js:115605
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/usr/lib/node_modules/truffle/build/cli.bundled.js:115605:11)
at setFSEventsListener (/usr/lib/node_modules/truffle/build/cli.bundled.js:115659:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/usr/lib/node_modules/truffle/build/cli.bundled.js:115823:16)
at FSWatcher.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:115957:25)
at gotStat (fs.js:1783:21)
at FSReqWrap.oncomplete (fs.js:152:21)
$
When will this be fixed? I keep having to install different versions of Truffle to get different functionality :(
Same issue on Windows Platform
Use “truffle init webpack”
and "npm run dev" instead of "truffle serve"
Hello, is there any update on this issue? We're having problems.
This also prevents me using latest Truffle on Ubuntu (16.04).
I have noticed in the webpack build config that this line replaces fsevents with this empty exports object. I've changed that to export an object compatible with the FSEvents API and that seems to have alleviated the crash.
However I still can't get watching to work locally. Can others experiencing the problem check to see if it resolves anything for them?
This bug prevents me using Truffle v4.0.0-beta.0 (core: 4.0.0-beta.0) in watch mode too on Mac OS X
==
Command: truffle watch
/usr/local/lib/node_modules/truffle/build/cli.bundled.js:218559
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:218559:11)
at setFSEventsListener (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:218613:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:218777:16)
at FSWatcher.
at gotStat (fs.js:1793:21)
at FSReqWrap.oncomplete (fs.js:123:15)
edit package.json:
"dev": "webpack-dev-server --host 0.0.0.0 --port 8080"
to make ip:8080 ok
wish to fix this bug
CentOS Linux release 7.2.1511 (Core)
npm-watch is a lighter solution (especially if you are not using webpack) - it basically just a wrapper around nodemon (which is what should be used instead of fsevents as it is portable)
add these bits to your package.json
{
"devDependencies": {
"truffle": "^3.4.9",
"npm-watch": "^0.2.0"
},
"scripts": {
"pretest": "truffle compile",
"test": "truffle test",
"watch": "npm-watch"
},
"watch": {
"test": {
"patterns": [
"contracts",
"migrations",
"test"
],
"extensions": "js,json,sol"
}
}
}
then to start the watch npm run watch
more details on configuring npm-watch at https://github.com/M-Zuber/npm-watch
@carchrae thanks! that helped
I ended up with this config for 4.x version:
````
{
"dependencies": {
"npm-watch": "^0.2.0"
},
"scripts": {
"test": "truffle test",
"watch": "npm-watch"
},
"watch": {
"test": {
"patterns": [
"truffle",
"test",
"contracts"
],
"extensions": "js,json,sol"
}
},
}
Facing the same problem in Ubuntu 16.04
`truffle serve
Serving static assets in ./build on port 8080...
/usr/local/lib/node_modules/truffle/build/cli.bundled.js:114396
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
`
npm uninstall -g truffle
npm install -g [email protected]
i'hava sloulation this probloem
nice
try npm install -g [email protected] --unsafe-perm
same problem. Truffle 4.0.1 on Ubuntu
same problem. Truffle 4.0.1 on MAC.
and i've fixed it.
clone the project locally with
git clone https://github.com/trufflesuite/truffle && cd truffle
echo 'module.exports = null ' > null.js
and then edit the file cli.webpack.config.js on line 85
"fsevents": path.join(__dirname, "./null.js"),
run
npm run build
npm uninstall -g truffle
npm install -g truffle `pwd`
that's it!
@mengjiaqi NB!
@mengjiaqi does that actually fix watch mode now, or just avoid the crash? I guess I'd have to test on Ubuntu to be sure. I had a PR earlier where I fixed the crash via the same sort of faux-fsevents object, but watch still didn't actually work.
$ truffle --version
Truffle v4.0.1 - a development framework for Ethereum
$ truffle serve
Serving static assets in ./build on port 8080...
/usr/local/lib/node_modules/truffle/build/cli.bundled.js:219284
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:219284:11)
at setFSEventsListener (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:219338:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:219502:16)
at FSWatcher.
at gotStat (fs.js:1783:21)
at FSReqWrap.oncomplete (fs.js:152:21)
OS: MacOS 10.13.1 (17B48)
@pospi It just avoid the crash.
@mengjiaqi works like a charm. Thanks!
@mengjiaqi When I go to do 'npm run build' I get the error 'webpack not found', I have installed Truffle 4.0.4 and I have also already unboxed a webpack on the server but still get this error.
Any ideas?
Is there any documentation on how to actually deploy these Dapps onto a remote server using truffle 4?
@mengjiaqi meng cool
I also have the same problem on Ubuntu 16.04 when I try to executive the command of "truffle serve"
TypeError: fsevents is not a constructor
Have the same issue:
PS C:ToDel> truffle serve
Serving static assets in .build on port 8080...
C:UserstestuAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:220548
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (C:UserstestuAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:220548:11)
at FSReqWrap.oncomplete (fs.js:152:21)
PS C:ToDel> truffle version
Truffle v4.0.5 (core: 4.0.5)
Solidity v0.4.18 (solc-js)
PS C:ToDel>
Have the same issue:
Truffle v4.0.6 (core: 4.0.6)
Solidity v0.4.19 (solc-js)
mac os 10.12.6
npm uninstall -g truffle
npm install -g [email protected]
mkdir truffle-webpack
cd truffle-webpack
truffle init webpack
truffle compile
npm run dev
don't run "truffle serve" , run "npm run dev" instead of
i'hava sloulation this probloem on Mac os 10.12.6
Have the same problem :
Truffle v4.0.6 (core: 4.0.6)
Solidity v0.4.19 (solc-js)
mac os 10.13.3
Have the same problem :
Truffle v4.0.6 (core: 4.0.6)
Solidity v0.4.19 (solc-js)
mac os 10.12.3
please provide some solution
npm uninstall -g truffle
npm install -g [email protected]
mkdir truffle-webpack
cd truffle-webpack
truffle init webpack
truffle compile
npm run dev
ubuntu is worked~
Truffle v4.1.5 (core: 4.1.5)
Solidity v0.4.21 (solc-js)
Have the same problem.
Same issue here on macOS High Sierra
Truffle v4.1.3 (core: 4.1.3)
Solidity v0.4.19 (solc-js)
npm ERR! missing script: dev
Have the same problem:
➜ truffleTest truffle version
Truffle v4.1.8 (core: 4.1.9)
Solidity v0.4.24 (solc-js)
➜ truffleTest truffle serve
Serving static assets in ./build on port 8080...
/usr/local/lib/node_modules/truffle/build/webpack:/~/chokidar/lib/fsevents-handler.js:26
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/usr/local/lib/node_modules/truffle/build/webpack:/~/chokidar/lib/fsevents-handler.js:26:1)
at setFSEventsListener (/usr/local/lib/node_modules/truffle/build/webpack:/~/chokidar/lib/fsevents-handler.js:80:1)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/usr/local/lib/node_modules/truffle/build/webpack:/~/chokidar/lib/fsevents-handler.js:244:1)
at FSWatcher.
at gotStat (fs.js:1824:21)
at FSReqWrap.oncomplete (fs.js:170:21)
Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.
There has been no new activity on this issue since it was marked as stale 7 days ago, so it is being automatically closed. If you'd like help with this or a different problem, please open a new issue. Thanks!
Most helpful comment
I had a similar issue and this is what fixed it for me was to re-initialize a new truffle instance with "truffle init webpack" :
``
➜ truffle> truffle serve Serving static assets in ./build on port 8080... /Users/thfalgou/.nvm/versions/node/v6.6.0/lib/node_modules/truffle/build/cli.bundled.js:115605 return (new fsevents(path)).on('fsevent', callback).start(); ^ ➜ truffle> cd .. ➜ ethereum> mkdir truffle-webpack ➜ ethereum> cd truffle-webpack ➜ truffle-webpack> truffle init webpack Usingtruffle initwith a specific template is deprecated. Please usetruffle unbox` instead....
➜ truffle-webpack> truffle compile
Compiling ./contracts/ConvertLib.sol...
...
➜ truffle-webpack> truffle migrate
Using network 'development'.
...
➜ truffle-webpack> npm run dev
Project is running at http://localhost:8080/