https://pantsbuild.org/ logo
#general
Title
# general
c

chilly-planet-38178

07/12/2017, 6:41 AM
I'm having trouble with yarn and self made node modules that are configured as dependencies in my other projects. Here are couple of examples of my build files (auto generated): escaper:
Copy code
node_module(
name='escaper',
sources=globs(
'package.json',
'lib/*.js',
'test/*.js',
'yarn.lock',
),
dependencies=[
'projects/node/modules/examples/echoer',
':mocha',
':chai',
],
dev_dependency=True,
package_manager='yarn',
)
node_test(
name='unit',
dependencies=[
':escaper',
],
script_name='test',
)
node_remote_module(
name='mocha',
version='3.4.2',
tags='',
)
...
echoer:
Copy code
node_module(
name='echoer',
sources=globs(
'package.json',
'lib/*.js',
'test/*.js',
'yarn.lock',
),
dev_dependency=True,
package_manager='yarn',
dependencies=[
':mocha',
],
)
node_test(
name='unit',
dependencies=[
':echoer',
],
script_name='test',
)
node_remote_module(
name='mocha',
version='3.4.2',
tags='',
)
Running
pants test projects/node/modules/examples/escaper:unit
will result it
Cannot find module 'echoer'
error. But when I take out
package_manager='yarn'
(or change it to npm) from both build files, everything works again. @straight-waiter-86090 and @witty-crayon-22786, you've helped me with these things previously (and thanks for that!) but any ideas now? 🙂