0

I'm trying to commit a vue.js project on a git repository. I'm sure my .gitignore works, because I already did a checkout without get the node_modules repository. However when I commit, I have synthax errors appearing for my node_modules.

I tried to remove the node_modules repository, but I had a cannot find module error. I tried to correct the error, but the computer find another error.

An example of the error I got :

[user@server mgtsm]$ git commit -m "Ajout des templates de message" /home/user/git/mgtsm/node_modules/yorkie/node_modules/execa/index.js:2 const childProcess = require('child_process'); ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/home/fs623/git/mgtsm/node_modules/yorkie/src/runner.js:3:15) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10)

pre-commit hook failed (add --no-verify to bypass)

Could you help me please ?

ANAFLY
  • 1
  • 2
  • Has the `node_modules` folder already been committed? – evolutionxbox Jan 28 '21 at 11:10
  • 2
    The last line provides the clue: `pre-commit hook failed (add --no-verify to bypass)` – Sumurai8 Jan 28 '21 at 11:11
  • 2
    Check the linter configuration. If should be ignoring the `node_modules` folder – evolutionxbox Jan 28 '21 at 11:13
  • The node_modules has not been already committed. What is the linter configuration @evolutionxbox ? – ANAFLY Jan 28 '21 at 11:21
  • Thanks a lot @Sumurai8 I didn't saw it. However I'm afraid to use it and break my git repository. – ANAFLY Jan 28 '21 at 11:21
  • This isn't going to break the git repo. You have a "linter" checking the code on commit. It is complaining about `node_modules`. Which "linter" are you using? – evolutionxbox Jan 28 '21 at 11:22
  • Either you need to skip the hook (which kinda defeats its purpose), or you need to figure out how to configure yorkie/what node version they normally use. I am not familiar with yorkie, so I don't know what you need to change there. I am assuming you are using a newer or older version of node that does not allow certain syntax. – Sumurai8 Jan 28 '21 at 11:22

0 Answers0