Package Details: nodejs-jshint 2.13.3-1

Git Clone URL: https://aur.archlinux.org/nodejs-jshint.git (read-only, click to copy)
Package Base: nodejs-jshint
Description: Static analysis tool for JavaScript
Upstream URL: https://jshint.com/
Licenses: MIT
Submitter: None
Maintainer: alerque
Last Packager: alerque
Votes: 57
Popularity: 0.019339
First Submitted: 2011-11-17 23:50 (UTC)
Last Updated: 2022-01-06 11:11 (UTC)

Latest Comments

christoph.gysin commented on 2021-03-24 07:35 (UTC)

Please remove --user root to avoid installing the root npm module

tjbp commented on 2020-02-13 07:58 (UTC)

@caleb the .SRCINFO has a package release of 5, but the PKGBUILD is set to 4. This results in an endless installation loop - please bump the PKGBUILD to match. Thanks!

alerque commented on 2020-02-10 11:07 (UTC) (edited on 2020-02-10 15:27 (UTC) by alerque)

@GFdevelop Thanks for the pointer to npm docs. I only adopted this to bump the version originally and was unaware of the npm issues (as it's not my usual stomping ground). I think I've fixed everything you mentioned.

Edit: Also fixed similar issues is a few other things I have in the AUR, so thanks again for better packages all round.

GFdevelop commented on 2020-02-10 10:21 (UTC) (edited on 2020-02-10 10:51 (UTC) by GFdevelop)

In the arch wiki there are only 3 rules for npm packages and this package don't respect one of them:

  • 777 permissions and non root owner
  • temporary cache littering my home
  • the package contains reference to $srcdir/$pkgdir

Please read here: https://wiki.archlinux.org/index.php/Node.js_package_guidelines

The fix is:

package() {
    npm install -g --user root --prefix "$pkgdir/usr" "$srcdir/${source[@]##*/}"

    # Non-deterministic race in npm gives 777 permissions to random directories.
    # See <https://github.com/npm/npm/issues/9359> for details.
    find "${pkgdir}/usr" -type d -exec chmod 755 {} +

    # npm gives ownership of ALL FILES to build user
    # <https://bugs.archlinux.org/task/63396>
    chown -R root:root "$pkgdir"

    find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'

    local tmppackage="$(mktemp)"
    local pkgjson="$pkgdir/usr/lib/node_modules/$_npmname/package.json"
    jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
    mv "$tmppackage" "$pkgjson"
    chmod 644 "$pkgjson"
}

Neelo commented on 2019-04-30 00:57 (UTC)

You should probably follow the Node.js Package Guidelines (https://wiki.archlinux.org/index.php/Node.js_package_guidelines) and include the fix for the race condition to avoid issues like the one DeemoDing mentioned.

DeemoDing commented on 2018-12-28 11:30 (UTC)

[2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/bin/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/data/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/dist/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/node_modules/concat-map/example/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/node_modules/concat-map/test/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/node_modules/core-util-is/ filesystem: 755 package: 777 [2018-12-28 17:24] [ALPM] warning: directory permissions differ on /usr/lib/node_modules/jshint/node_modules/date-now/ filesystem: 755 package: 777 ...............

I think you know what happens

alerque commented on 2018-08-22 11:09 (UTC)

@sum01 Done.

sum01 commented on 2018-03-03 18:00 (UTC) (edited on 2018-03-03 18:00 (UTC) by sum01)

Can npm be made a makedepends instead of depends?

BoySka commented on 2016-02-24 20:01 (UTC)

https:// in the source will work; could you switch to it? I can submit a patch, but it is probably easier if you just do it yourself.

justin8 commented on 2015-05-21 23:44 (UTC)

Hi, it looks like this needs to depend on npm now as well: Notice: npm is not shipped with nodejs since 0.12.2-4, please install npm manually if you need it. Optional dependencies for nodejs npm: nodejs package manager /startdir/PKGBUILD: line 22: npm: command not found

Marcel_K commented on 2014-12-02 22:51 (UTC)

I now see that the MIT license is available in the source code, you can extract it from /usr/lib/node_modules/jshint/src/jshint.js. BTW, you shouldn't add multiple maintainer lines in your PKGBUILD, only add yourself as maintainer and the others as contributors. That way, it's easier to contact the current maintainer.

neg3ntropy commented on 2014-12-02 21:32 (UTC)

PKGBUILD for version 2.5.10: # Author: Anton Kovalyov <anton@kovalyov.net> (http://anton.kovalyov.net/) # Maintainer: brentlintner <brent.lintner@gmail.com> # Maintainer: antonkovalyov <anton@kovalyov.net> # Maintainer: cracoucass14 # Maintainer: jnbek pkgname=nodejs-jshint # All lowercase _npmname=jshint pkgver=2.5.10 _npmver=$pkgver pkgrel=1 pkgdesc="Static analysis tool for JavaScript" arch=(any) url="http://jshint.com/" license=(MIT) depends=('nodejs') optdepends=() source=(http://registry.npmjs.org/$_npmname/-/$_npmname-$_npmver.tgz) noextract=($_npmname-$_npmver.tgz) sha1sums=('2fef47ee0901914e31832123d5d3f434c28060ef') package() { cd "$srcdir" local _npmdir="$pkgdir/usr/lib/node_modules/" mkdir -p "$_npmdir" cd "$_npmdir" npm install --user root -g --prefix "$pkgdir/usr" $_npmname@$_npmver }

Marcel_K commented on 2014-10-13 14:21 (UTC)

You should at lesat really fix the ownership of the files, like http://pastebin.com/Ab2CBAEN

michurin commented on 2014-07-01 10:57 (UTC)

Update PKGBUILD please: 6c6 < _npmver=2.5.0 --- > _npmver=2.5.1 8c8 < pkgver=2.5.0 --- > pkgver=2.5.1 18c18 < sha1sums=('82fd1a235ffce75fad1b40b2a38bef47beac8c54') --- > sha1sums=('8e96d27377806767d40f16676fbec113d33520ec')

jnbek commented on 2014-04-14 19:48 (UTC)

Releasing to the wild. The project I was working on that required this package fell through and I don't really have the time to maintain this, along with the 800 other packages I'm working on.

Lekensteyn commented on 2013-03-16 09:38 (UTC)

This package suffers from the same problem as nodejs-grunt, installed files are owned by nobody (nobody shouldn't get any write access!). Furthermore, the license (LICENSE -> MIT) is missing. https://github.com/Lekensteyn/aur/commit/b6647bd