You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't install node based hooks (jshint, jscs, eslint, etc.) with node 5.0.0 #282
I came across npm not managing to install jshint pre-commit. It worked well before commit e8a870d. I ran manually the commands to generate nodeenv with python -m nodeenv --prebuilt and python -m nodeenv -n system. The latter works well but the first one (when simply running pre-commit run --all-files to generate environment) gives the following error:
Errors:
npm ERR! Linux 3.13.0-66-generic
npm ERR! argv "/home/tdeo/.pre-commit/repopFVtES/node_env-default/bin/node" "/home/tdeo/.pre-commit/repopFVtES/node_env-default/bin/npm" "install" "-g"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! path /home/tdeo/.pre-commit/repopFVtES/node_env-default/lib/node_modules/.staging/__dummy_package-8df1665f65762053e4e7ca8e2f98517f
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/tdeo/.pre-commit/repopFVtES/node_env-default/lib/node_modules/.staging/__dummy_package-8df1665f65762053e4e7ca8e2f98517f' -> '/home/tdeo/.pre-commit/repopFVtES/node_env-default/lib/node_modules/__dummy_package'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/tdeo/.pre-commit/repopFVtES/npm-debug.log
If you want, I can regenerate the error and get the full log (I made the installation with system node after).
Maybe this is related to npm/npm#10166, I found few results on Google
Also, everything goes fine when I generate nodeenv with node 4.2.1 by python -m nodeenv -v -n 4.2.1 --prebuilt
Is there any possibility to have some configuration for node version ?
Hmmm, let me try and reproduce this locally -- we may need to change the approach we take for our dummy packages.
EDIT: could you include the npm-debug.log file it mentions above? It might be difficult to grab since pre-commit'll delete that directory but maybe you can set a breakpoint right before that happens? If not, when I reproduce I should be able to grab it :)
I'm running into this as well. At first I thought it was a CI issue, but after I ran pre-commit clean I'm getting the same thing locally. The workaround above seems to work great 👍.
@brettmcintosh, this will apply to any hook that runs in Node. I went through my pre-commit config file and added language_version for Node-based hook...
changed the title [-]Can't install jshint with node 5.0.0[/-][+]Can't install node based hooks (jshint, jscs, eslint, etc.) with node 5.0.0[/+]on Nov 8, 2015
With the latest version of pre-commit and the latest version of these hooks it should be fixed.
For those of you mirroring nodejs repositories, I'd suggest (re?)generating newer versions with the latest pre-commit-mirror-maker which has a fix for this.
Activity
asottile commentedon Nov 2, 2015
Hmmm, let me try and reproduce this locally -- we may need to change the approach we take for our dummy packages.
EDIT: could you include the npm-debug.log file it mentions above? It might be difficult to grab since pre-commit'll delete that directory but maybe you can set a breakpoint right before that happens? If not, when I reproduce I should be able to grab it :)
asottile commentedon Nov 2, 2015
Seems to reproduce for me as well:
asottile commentedon Nov 2, 2015
As a workaround you can craft a config that looks like this:
asottile commentedon Nov 2, 2015
I think it's more likely these issue:
npm installin npm repo explodes npm/npm#9847elidupuis commentedon Nov 2, 2015
I'm running into this as well. At first I thought it was a CI issue, but after I ran
pre-commit cleanI'm getting the same thing locally. The workaround above seems to work great 👍.tdeo commentedon Nov 3, 2015
It worked perfectly for me. Thanks!
othiym23 commentedon Nov 6, 2015
This is indeed a duplicate of npm/npm#9633 (and making sure it gets fixed 🔜).
brettmcintosh commentedon Nov 8, 2015
Same problem when installing jscs. Workaround config:
elidupuis commentedon Nov 8, 2015
@brettmcintosh, this will apply to any hook that runs in Node. I went through my pre-commit config file and added
language_versionfor Node-based hook...[-]Can't install jshint with node 5.0.0[/-][+]Can't install node based hooks (jshint, jscs, eslint, etc.) with node 5.0.0[/+]asottile commentedon Dec 11, 2015
I'm working on a workaround in pre-commit-mirror-maker that'll use the features added in #295 #311 #316
asottile commentedon Dec 13, 2015
With the latest version of pre-commit and the latest version of these hooks it should be fixed.
For those of you mirroring nodejs repositories, I'd suggest (re?)generating newer versions with the latest pre-commit-mirror-maker which has a fix for this.
elidupuis commentedon Dec 14, 2015
@asottile For nodejs repositories, is it enough to simply update
pre-commit-mirror-maker, re-run it, and push up the new commits?asottile commentedon Dec 14, 2015
@elidupuis from the repo side, yes. Consumers should update pre-commit and pull the latest version of those hooks as well.
elidupuis commentedon Dec 14, 2015
Cool, thanks!
Merge pull request pre-commit#282 from pre-commit/all-repos_autofix_a…