Ignite: OS X 10.12: "env: node: No such file or directory" on git commit

Created on 28 Feb 2017  路  9Comments  路  Source: infinitered/ignite

Hi

My Environment:

$ which node
/usr/local/bin/node

$ which npm
/usr/local/bin/npm

i try to change #!/usr/bin/env node on .git/hooks/pre-commit to #!/usr/local/bin/node
but then i got this error on commit:
"fatal: cannot exec '.git/hooks/pre-commit': Permission denied"

thanks

question

Most helpful comment

Gotcha. ghooks recently deprecated itself in favour of husky.

If you're not using this stuff right now, you can

rm -rf .git/hooks/*
npm rm --save-dev ghooks

And remove that both the config key and the scripts/precommit,scripts/prepush, scripts/postrewrite, and git-hook keys from package.json.

Was this a fresh ignite new Luis project?

If so, we've got something wrong with our templates. Probably missed it because we're focus on wrapping up Ignite 2.

All 9 comments

  • Is this with Ignite 1 or Ignite 2?
  • Do you use nvm, n,brew, or something else to manage your node installs?
  • Can you run ignite doctor please and paste the output?

Let's see if we can get this straightened out.

@skellock I use brew

ignite doctor output:

Computer
  Platform: darwin

Ignite
  Version: 1.13.0
  Path: /usr/local/bin/ignite

Node
  Version: v6.2.2
  Path: /usr/local/bin/node

NPM
  Version: 4.1.2
  Path: /usr/local/bin/npm

Yeoman
  Version: 1.8.5

React Native CLI
  Version: 2.0.1

App
  React Native Version: 0.38.0

How did you install your react native application? with ignite new Luis?

Can you check your permissions with ls -la .git/hooks | pbcopy.

Does that line up with whoami as well?

@skellock yes, I instal my app with ignite new project_name

ls -la .git/hooks :

total 136
drwxr-xr-x  19 lmachado  staff   646 Feb 28 15:56 .
drwxr-xr-x  14 lmachado  staff   476 Feb 28 15:56 ..
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 applypatch-msg
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 commit-msg
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-applypatch
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-checkout
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-commit
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-merge
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-receive
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-rewrite
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 post-update
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 pre-applypatch
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 pre-auto-gc
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 pre-commit
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 pre-push
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 pre-rebase
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 pre-receive
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 prepare-commit-msg
-rwxr-xr-x   1 lmachado  staff  1662 Feb 28 15:56 update

my whoami is lmachado

Hmm.. everyone looks great so far. Is this using husky or ghooks? (correct answer is husky). You can double check by verifying your package.json devDependencies.

Also, while you're in there, do you have the right scripts installed too?

image

it is using ghooks and i don't have any of that scripts instaled

"config": {
    "ghooks": {
      "pre-commit": "if [ -d 'ignite-base' ]; then cd ignite-base; fi; npm run lint"
    }
  }

Gotcha. ghooks recently deprecated itself in favour of husky.

If you're not using this stuff right now, you can

rm -rf .git/hooks/*
npm rm --save-dev ghooks

And remove that both the config key and the scripts/precommit,scripts/prepush, scripts/postrewrite, and git-hook keys from package.json.

Was this a fresh ignite new Luis project?

If so, we've got something wrong with our templates. Probably missed it because we're focus on wrapping up Ignite 2.

it is working, i removed all references to git-hook and there is no problem anymore at git commit.

it has a fresh ignite new <project>

Any prevision for the release of Ignite 2? I'm very excited about that ;)

Glad it's working now.

We're going beta this week. 馃帀

See ya on the other side.

Was this page helpful?
0 / 5 - 0 ratings