question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

truffle init problem

See original GitHub issue

After installing truffle, and trying to launch it with truffle init, I get the following errors:

m@888@m:~/dmc/truffleTest$ npm rebuild node-sass

> node-sass@3.4.1 install /home/m/dmc/node_modules/node-sass
> node scripts/install.js


> node-sass@3.4.1 postinstall /home/m/dmc/node_modules/node-sass
> node scripts/build.js

` /home/m/dmc/node_modules/node-sass/vendor/linux-x64-46/binding.node ` exists. 
 testing binary.
Binary is fine; exiting.
node-sass@3.4.1 /home/m/dmc/node_modules/node-sass
m@888@m:~/dmc/truffleTest$ truffle init
Error: The `libsass` binding was not found in /home/m/npm-global/lib/node_modules/truffle/node_modules/node-sass/vendor/linux-x64-46/binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.
  at Object.sass.getBinaryPath (/home/m/npm-global/lib/node_modules/truffle/node_modules/node-sass/lib/extensions.js:158:11)
  at Object.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/node_modules/node-sass/lib/index.js:16:36)
  at Module._compile (module.js:435:26)
  at Module._extensions..js (module.js:442:10)
  at Object.require.extensions.(anonymous function) [as .js] (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:214:7)
  at Module.load (/home/m/npm-global/lib/node_modules/truffle/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:311:12)
  at Module.require (module.js:366:17)
  at require (module.js:385:17)
  at Object.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/lib/processors/scss.es6:3:12)
  at Module._compile (module.js:435:26)
  at normalLoader (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:199:5)
  at Object.require.extensions.(anonymous function) [as .es6] (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:216:7)
  at Module.load (/home/m/npm-global/lib/node_modules/truffle/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
  at Function.Module._load (module.js:311:12)
  at Module.require (module.js:366:17)
  at require (module.js:385:17)
  at Object.gather (/home/m/npm-global/lib/node_modules/truffle/lib/config.es6:227:38)
  at /home/m/npm-global/lib/node_modules/truffle/truffle.es6:150:23
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/deasync/index.js:35:6
  at runTask (/home/m/npm-global/lib/node_modules/truffle/truffle.es6:55:5)
  at Object.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/truffle.es6:347:14)
  at Module._compile (module.js:435:26)
  at normalLoader (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:199:5)
  at Object.require.extensions.(anonymous function) [as .es6] (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:216:7)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Function.Module.runMain (module.js:467:10)
  at Object.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/lib/_babel-node.js:144:25)
  at Module._compile (module.js:435:26)
  at Object.Module._extensions..js (module.js:442:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Function.Module.runMain (module.js:467:10)
  at startup (node.js:134:18)
  at node.js:961:3

Note that before launching truffle, I did npm rebuild node-sass , but still get the corresponding error. Please help

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:46 (16 by maintainers)

github_iconTop GitHub Comments

9reactions
tcoultercommented, Oct 29, 2015

It looks to me like truffle wasn’t properly installed (i.e., an npm issue). Do an npm uninstall -g truffle and then an npm install -g truffle and see if that solves it.

5reactions
danielrussellLAcommented, Oct 23, 2017

I had a similar problem. I ran npm i -g truffle and then when I tried to run truffle init I got an error: zsh: command not found: truffle. What solved it for me is to create a local node_modules with truffle installed in it, and then run that copy.

  1. run npm init and make a new npm project
  2. run npm i truffle
  3. run ./node_modules/.bin/truffle init and it should work

unfortunately, with this method, you’d have to call all commands by prepending ./node_modules/.bin/truffle to the command

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while doing truffle init. EDIT: Truffle isn't working itself
I feel I know what the problem is. The syntax error is occurring because of uneven number of opening and closing brackets. I...
Read more >
Truffle init returns cannot find module - node.js - Stack Overflow
I've solved the issue. All you need to do is to run "npm install -g truffle@5.4.29" This will install an older version of...
Read more >
Truffle Command Doesn't Work? Solution. - Mammoth Interactive
Are you trying to start a new Truffle project with the Terminal command 'truffle init'? Maybe you're trying to use truffle for something...
Read more >
When I ran truffle init I got this error | Edureka Community
Hey there @Davidala! The error says that it couldn't find the 'original-require' module. The solution to this error is to install this module....
Read more >
Truffle init Syntax error: unexpected token (Rarible tutorial NR 6)
This could be related to your node version. As a developer I'd highly recommend using Node Version Manager (nvm) as many packages have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found