-
Couldn't load subscription status.
- Fork 1.4k
Open
Labels
Description
protobuf.js version: 6.6.5
When using the CLI version of protobuf.js, some additional dependencies are installed (they are defined without versions in cliDependencies of the package.json.
There are a few issues with this approach that I hope we can find a solution for:
- The project I am using is using
yarn, meaning that whereverpbjswas installed into does not havenpmavailable on CI. - Locally there is npm available, but quite often the install fails:
$ ./proto/gen.js.sh
installing jsdoc@^3.4.2
installing [email protected]
installing espree@^3.1.3
installing escodegen@^1.8.1
module.js:472
throw err;
^
Error: Cannot find module 'espree'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/joscha/Development/wala/wala-sodaqone_3/node_modules/protobufjs/cli/targets/static.js:7:18)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
error Command failed with exit code 1.
- The dependencies that are installed on-the-fly are not part of any
yarn.lockornpm-shrinkwrap.json, meaning that the installation can 1) not be cached easily 2) not be reproduced easily 3) yarn will blow away any installed packages not part of the lock file any timeyarn installis run 4)npm shrinkwrapwill wet itself because there are additional packages installed.
A couple solutions come to mind:
- Make these actual
dependencies- after all they are used at runtime - Create a
protobuf.js-clipackage that has a dependency on theprotobuf.jspackage and on all the CLI dependencies. That way this package could be lightweight for the people that are not interested in the CLI.
What do you think?
davemecha, alejandroclaro, IanVS, pauldraper, louis030195 and 1 more