2

I've been trying to get jslint to run on my system but have failed. I went with the npm route and simply ran sudo npm install -g jslint I'm using the nodejs package not node-legacy. I also made a symbolic link to: sudo ln -s /usr/bin/nodejs /usr/bin/node because it wasn't finding node. So JSlint insalled but when i run jslint in the terminal I get this: `

module.js:340
    throw err;
      ^
Error: Cannot find module 'readable-stream'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/felipe/.npm/j slint/0.9.0/package/lib/stream.js:1:80)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)`

so I ran sudo npm install -g readable-stream , to verify I looked in /home/me/.npm/ and there is indeed a readable-stream folder. Version 1.0.33 to be exact. And I still get the same error. So I'm out of ideas. I would appreciate any help on trying to resolve this issue.

I was trying to get JSLint to work on sublime text 3 by using package install --> JSLint and I also tried SublimeLinter but I've failled with all 3. I could always install brackets which comes with JSLint by default but I'd like to get it to work in the terminal as well and possibly st3

1 Answer 1

1

The problem seems to be happening here:

/home/felipe/.npm/j slint/0.9.0/package/lib/stream.js:1:80

(Not sure what that space is doing in j slint... maybe that's worth looking into?) If you look at the contents of that file, you should see something like this:

module.exports = require('readable-stream');

Nothing too revolutionary there, but for some reason your setup seems to be failing to resolve that dependency. One thing you can do is install it manually inside the jslint folder:

cd ~/.npm/jslint/0.9.0/package
npm install

This will find the package.json file inside the jslint directory and install all of its dependencies locally in a node_modules folder.

If that doesn't work, something is really broken. In that case, I'd be inclined to blame the Node.js packaging on Ubuntu and recommend you start over, using nvm to manage node.

You must log in to answer this question.