Describe the bug
I have a postinstall script in my package.json.
When running npm install on my machine I get the following error:
npm error command failed
npm error command sh -c node ./run.js
npm error node:child_process:966
npm error throw err;
npm error ^
npm error
npm error Error: Command failed: yarn run postinstall
npm error at genericNodeError (node:internal/errors:984:15)
npm error at wrappedFn (node:internal/errors:538:14)
npm error at checkExecSyncError (node:child_process:891:11)
npm error at execSync (node:child_process:963:15)
npm error at Object.<anonymous> (/XXX/node_modules/postinstall-postinstall/run.js:15:5)
npm error at Module._compile (node:internal/modules/cjs/loader:1529:14)
npm error at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
npm error at Module.load (node:internal/modules/cjs/loader:1275:32)
npm error at Module._load (node:internal/modules/cjs/loader:1096:12)
npm error at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:164:12) {
Expected behavior
postinstall scripts to successfully complete.
Development environment:
- OS: MacOS
- nodejs: 20.19.4
- react-native: 0.81.6
- react-native-image-marker : 1.2.6
I noticed that the package.json in your library has patch-package and postinstall-postinstall in the dependencies section.
The presence of postinstall-postinstall as a dependency is what is causing the issue on my machine.
I patched my project by adding this to my package.json:
"overrides": {
"react-native-image-marker": {
"postinstall-postinstall": "npm:noop@^1.0.1"
}
}
To solve the issue permanently, would be possible to move patch-package and postinstall-postinstall to devDependencies section of the library package.json?
Describe the bug
I have a
postinstallscript in mypackage.json.When running
npm installon my machine I get the following error:Expected behavior
postinstall scripts to successfully complete.
Development environment:
I noticed that the
package.jsonin your library haspatch-packageandpostinstall-postinstallin thedependenciessection.The presence of
postinstall-postinstallas a dependency is what is causing the issue on my machine.I patched my project by adding this to my
package.json:To solve the issue permanently, would be possible to move
patch-packageandpostinstall-postinstalltodevDependenciessection of the librarypackage.json?