0x80 / isolate-package

Isolate a monorepo package with its internal dependencies to form a self-contained directory with a pruned lockfile
MIT License
121 stars 13 forks source link

Could not install from "../../apps/functions/isolate/__tmp" as it does not contain a package.json file #7

Closed g3rard0m3lt closed 1 year ago

g3rard0m3lt commented 1 year ago

Can't isolate packages

Screen Shot 2023-06-08 at 1 17 12 PM

NPM log

1 verbose cli [
1 verbose cli   '/Users/mac/.nvm/versions/node/v14.21.3/bin/node',
1 verbose cli   '/Users/mac/.nvm/versions/node/v14.21.3/bin/npm',
1 verbose cli   'pack',
1 verbose cli   '--pack-destination',
1 verbose cli   '/Users/mac/Projects/suscripciones/apps/functions/isolate/__tmp'
1 verbose cli ]
2 info using npm@6.14.18
3 info using node@v14.21.3
4 verbose npm-session 3bb98f59d50c53a9
5 silly fetchPackageMetaData error for /Users/mac/Projects/suscripciones/apps/functions/isolate/__tmp Could not install from "../../apps/functions/isolate/__tmp" as it does not contain a package.json file.
6 verbose stack Error: ENOENT: no such file or directory, open '/Users/mac/Projects/suscripciones/apps/functions/isolate/__tmp/package.json'
7 verbose cwd /Users/mac/Projects/suscripciones/packages/api
8 verbose Darwin 20.5.0
9 verbose argv "/Users/mac/.nvm/versions/node/v14.21.3/bin/node" "/Users/mac/.nvm/versions/node/v14.21.3/bin/npm" "pack" "--pack-destination" "/Users/mac/Projects/suscripciones/apps/functions/isolate/__tmp"
10 verbose node v14.21.3
11 verbose npm  v6.14.18
12 error code ENOLOCAL
13 error Could not install from "../../apps/functions/isolate/__tmp" as it does not contain a package.json file.
14 verbose exit [ 1, true ]

isolate.config.json

Screen Shot 2023-06-08 at 1 19 30 PM
g3rard0m3lt commented 1 year ago

Updating npm worked for me!

0x80 commented 1 year ago

@g3rard0m3lt great! 👍

Maybe a tip; Instead of isolating/deploying from the root of your repo it should be possible to keep the configuration inside your apps/functions directory and deploy from there. This way you can have multiple independent packages deploy to firebase, and you can keep files like firebase.json inside their respective packages.

Also, for firebase deployment it shouldn't be necessary to include the dev dependencies. The firebase cloud deploy pipeline should only install production deps.