Package Details: nodejs-jshint 2.11.1-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: caleb
Last Packager: caleb
Votes: 56
Popularity: 1.01
First Submitted: 2011-11-17 23:50
Last Updated: 2020-06-22 11:34

Latest Comments

1 2 Next › Last »

tjbp commented on 2020-02-13 07:58

@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!

caleb commented on 2020-02-10 11:07

@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

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

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

[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

caleb commented on 2018-08-22 11:09

@sum01 Done.

sum01 commented on 2018-03-03 18:00

Can npm be made a makedepends instead of depends?

BoySka commented on 2016-02-24 20:01

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

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

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.