BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
934 stars 325 forks source link

node-git-hooks package causes issue with Yarn PnP #351

Open Looooong opened 2 years ago

Looooong commented 2 years ago

Installing react-native-calendar-strip with Yarn 2 and PnP enabled would result in the following error:

# This file contains the result of Yarn building a package (react-native-calendar-strip@virtual:3567eff399af52e12588fde2b231d8f70e2493e0315d1aa647bee79d34fd18d77a3f7589995b83252d12b287908ae0e374aa2085e8207890918894d67263315e#npm:2.2.6)
# Script name: postinstall

C:\Projects\fitmode-mobile\.pnp.cjs:35643
      Error.captureStackTrace(firstError);
            ^

Error: Qualified path resolution failed: we looked for the following paths, but none could be accessed.

Source path: C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\package.json
Not found: C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\package.json
Not found: C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\package.json.js
Not found: C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\package.json.json
Not found: C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\package.json.node

Require stack:
- C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\node_modules\node-git-hooks\install-git-hooks.js
- C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\node_modules\node-git-hooks\bin\install.js
    at Function.require$$0.Module._resolveFilename (C:\Projects\fitmode-mobile\.pnp.cjs:35643:13)
    at Function.require$$0.Module._load (C:\Projects\fitmode-mobile\.pnp.cjs:35497:42)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at installGitHooks (C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\node_modules\node-git-hooks\install-git-hooks.js:8:19)
    at Object.<anonymous> (C:\Projects\fitmode-mobile\.yarn\unplugged\node-git-hooks-npm-1.0.6-8780059d3f\node_modules\node-git-hooks\bin\install.js:5:8)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.require$$0.Module._extensions..js (C:\Projects\fitmode-mobile\.pnp.cjs:35687:33)
    at Module.load (node:internal/modules/cjs/loader:981:32)

This is a bug in node-git-hooks package, which is triggered via postinstall script. However, this concerns react-native-calendar-strip package as the consumers of this library don't need/care about the side effect of postinstall script in this library. Given that node-git-hooks is not so popular and have not been received updates frequently, can you remove the postinstall script along with node-git-hooks and instead update the contribution guidlines to tells the developers to eslint the source code before commiting?