-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to run simple-git-hooks
with npx
or npm exec
#69
Comments
Thanks for the detailed report, seems like an issue with |
similar error while deploying to google app engine Running "yarn install --non-interactive --prefer-offline --modules-folder=/layers/google.nodejs.yarn/yarn_modules/node_modules --frozen-lockfile (PATH=/layers/google.nodejs.yarn/yarn_engine/bin:/layers/google.nodejs.runtime/node/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/layers/google.nodejs.yarn/yarn_modules/node_modules/.bin)"
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@^5.0.0".
[4/4] Building fresh packages...
error /layers/google.nodejs.yarn/yarn_modules/node_modules/simple-git-hooks: Command failed.
Exit code: 1
Command: node ./postinstall.js
Arguments:
Directory: /layers/google.nodejs.yarn/yarn_modules/node_modules/simple-git-hooks
Output:
node:internal/fs/utils:347
throw err;
^
Error: ENOENT: no such file or directory, stat '/layers/google.nodejs.yarn/yarn_modules/package.json'
at Object.statSync (node:fs:1588:3)
at _getPackageJson (/layers/google.nodejs.yarn/yarn_modules/node_modules/simple-git-hooks/simple-git-hooks.js:174:13)
at checkSimpleGitHooksInDependencies (/layers/google.nodejs.yarn/yarn_modules/node_modules/simple-git-hooks/simple-git-hooks.js:102:34)
at postinstall (/layers/google.nodejs.yarn/yarn_modules/node_modules/simple-git-hooks/postinstall.js:15:9)
at Object.<anonymous> (/layers/google.nodejs.yarn/yarn_modules/node_modules/simple-git-hooks/postinstall.js:24:1)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
errno: -2,
syscall: 'stat',
code: 'ENOENT',
path: '/layers/google.nodejs.yarn/yarn_modules/package.json'
} |
Similar error when calling
It doesn't seem to happen with newer versions of |
Any updates? |
I havent worked on this specific issue. Do you happen to encounter the same bug? |
Yes, This is the only way I can set it up to prevent pipeline interruptions |
Hey, can you please share some info on environment? Do you have In the meantime... I think I'll cook a way to make script fail silently if package.json is not found.. |
my host machine is running on node v14.21.3 (npm v6.14.18), |
Thanks for the info! Can you please provide one small detail: script crashes because it couldn't find package.json file.. Do you have |
Yes It exists, otherwise npm hooks will not execute. |
Issues
Running
simple-git-hooks
withnpx
ornpm exec
causes the installation to fail.Expected behavior
simple-git-hooks
should run correctly usingnpx
ornpm exec
locally.Actual behavior
Running
npx -y simple-git-hooks
ornpm exec -y -- simple-git-hooks@latest
throws error.Debugging details
The text was updated successfully, but these errors were encountered: