google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.84k stars 807 forks source link

check postinstall file exists https://github.com/google/model-viewer/… #4363

Closed btopro closed 1 year ago

btopro commented 1 year ago

…issues/4362

Reference Issue

Should fix #4362 introduced in version 3.2.0

This is a highly tooling specific script request which in yarn will cascade when projects implement 1 of the packages but not the entire mono-repo. I am using the model viewer tag in my own monorepo and yarn will call all the postinstall hooks it finds, looking then for whatever/node_modules/scripts/postinstall.js which is not a thing for downstream consumers.

I can't install w/ a fresh lock file currently but this is pattern off the other verifications of a file existing to avoid errors.

hilyas786 commented 1 year ago

Hi, i just encountered this issue again,

npm ERR! path /Users/node_modules/@google/model-viewer npm ERR! command failed npm ERR! command sh -c node ../../scripts/postinstall.js npm ERR! node:internal/modules/cjs/loader:942 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module '/Users/node_modules/scripts/postinstall.js' npm ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:939:15) npm ERR! at Module._load (node:internal/modules/cjs/loader:780:27) npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) npm ERR! at node:internal/main/run_main_module:17:47 { npm ERR! code: 'MODULE_NOT_FOUND', npm ERR! requireStack: [] npm ERR! } npm ERR! npm ERR! Node.js v18.0.