0

I know about jslint, but it has a web interface. I am a 60 years old geek using Linux since 1993 (and have developed the GCC MELT tool, with Bismon wanting to be some successor)

For the Bismon project (GPLv3+) I am coding some handwritten JavaScript using emacs, such as its webroot/jscript/Bismon-hwroot.js file.

Bismon (work in progress, funded by H2020 research projects like Chariot and Decoder) is itself some specialized web server described in this draft report, using libonion and also some domain specific language, with a semantics close to Scheme R5RS's one, some reflection, some metaprogramming facilities; but Bismon is also orthogonally persistent, with the persistent heap stored as some git managed textual files such as store1.bmon.

I do know that JavaScript semantics is really weird. I want a simple tool catching some (not all) basic mistakes (lack of closing parenthesis, some typos in variable names, etc...) but I need it on the command line for Linux.

This question summarizes well what Bismon wants to become and give both motivations and technical context that I won't repeat here.

The HTML5 code using webroot/jscript/Bismon-hwroot.js is entirely machine generated by Bismon. FWIW, ocsigen was somehow inspirational for Bismon, and I only care about recent browsers on Linux (e.g. firefox 68 on Linux)

Bismon is a low TRL research prototype.

My Linux system is a Debian/Sid

I did compile node-v13.6.0 from its source code after a ./configure --ninja --verbose --enable-trace-maps --enable-lto --debug --gdb followed by the appropriate invocation of ninja. Then I copied the resulting node executable (which works when started in a terminal) into my file $HOME/bin/node and $HOME/bin/ and my $PATH (for zsh) is set to $HOME/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin

I then tried

pcbasile node-v13.6.0/out/Release 13:56 % npm install -g jslint internal/modules/cjs/loader.js:976   throw err;   ^

Error: Cannot find module 'semver' Require stack:
- /usr/share/npm/lib/utils/unsupported.js
- /usr/share/npm/bin/npm-cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:973:15)
    at Function.Module._load (internal/modules/cjs/loader.js:855:27)
    at Module.require (internal/modules/cjs/loader.js:1033:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/share/npm/lib/utils/unsupported.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1144:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
    at Module.load (internal/modules/cjs/loader.js:993:32)
    at Function.Module._load (internal/modules/cjs/loader.js:892:14)
    at Module.require (internal/modules/cjs/loader.js:1033:19) {   code: 'MODULE_NOT_FOUND',   requireStack: [
    '/usr/share/npm/lib/utils/unsupported.js',
    '/usr/share/npm/bin/npm-cli.js'   ] }

If I export PATH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:$HOME/bin I am still getting a failure, but a different one:

     cd $HOME
     npm install -g jslint
npm WARN npm npm does not support Node.js v10.17.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/bin/jslint -> /usr/local/lib/node_modules/jslint/bin/jslint.js
+ jslint@0.12.1
updated 1 package in 1.02s

and I am getting the same error with export PATH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin

On my Debian/Sid npm is actually /usr/bin/npm, a script starting with #!/usr/bin/env node

PS. My login shell is zsh.

  • 1
    1. The command npm -g update npm should self-upgrade npm and this way you could get rid of the warning. --- 2: eslint is more powerful than jslint . So I'd do npm -g i eslint, although I think eslint will recommend/warn you to NOT install it globally. That is indeed cleaner because every project/directory could have its own eslint. But I think you can install globally though. – knb Jan 22 at 18:43
1

Is there something wrong with the jslint CLI?

Edit:

The installation is very simple on Debian. The following commands assuming you are using apt as a package manager and that you are logged in as root.

  1. apt install nodejs
  2. npm install -g jslint
  • How can I use that on Debian? There is no package named jslint .... – Basile Starynkevitch Jan 21 at 9:16
  • Ok. I just compiled from source code Node.Js13.6.0; I got a node executable. Do I need anything else? Take into account that I am a node.js newbie. – Basile Starynkevitch Jan 21 at 10:46
  • I don't even understand the installation procedure of node... – Basile Starynkevitch Jan 21 at 10:49
  • @BasileStarynkevitch I have updated my answer with Debian installation instructions. You should uninstall the nodejs you built from source. After installing jslint via npm, every user will be able to use the jslint command as if it was a native utility. – William Rosenbloom Jan 21 at 12:41
  • Why should I uninstall the nodejs I built from source? The Debian packaged one don't work – Basile Starynkevitch Jan 21 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.