When i create a zen subtheme. And go inside my theme and run npm install all dependent js packages get installed in sites/all/themes/zen_subtheme/node_modules.

The eslint package however has a dependenciy to the doctrine package which has lcov.info file (empty file).
full path: zen_subtheme/node_modules/eslint/node_modules/doctrine/coverage/lcov.info

This files causes warnings on the admin / appearance page since drupal thinks this is a bad formatted info file of subtheme inside zen_subtheme.

Comments

star-szr’s picture

Status: Active » Closed (works as designed)
mallezie’s picture

Title: warnings on admin/appearance page cause by node doctrine module » Add workaround for malformed info files in node_modules
Category: Bug report » Feature request
Status: Closed (works as designed) » Active

Thanks for the update, and links to the relevant core issues.
Could we add the temporary workaround as described in #2329453: Ignore front end vendor folders to improve directory search performance

Temporary work-around

To set up node modules for your theme or module, the standard way is to run npm init to create a package.json file. After that file is created, you'll need to edit it to include a post install script:

"scripts": {
"postinstall": "find node_modules/ -name '*.info' -type f -delete"
}
Now, when you or a user runs npm install, npm will install the node modules from package.json as normal, but then go through them all and delete .info files. Our only hope is that none of those files are essential for the node module to function.

This is not a sustainable solution since it requires all Drupal project maintainers and all Drupal front-end devs to know about this work-around or to successfully debug this problem (NOT EASY!)

If this seems not a good idea, please close again.

star-szr’s picture

mallezie’s picture

Title: Add workaround for malformed info files in node_modules » Add workaround for malformed info files in node_modules (2 levels deep)
Status: Active » Closed (duplicate)

hmm interesting.
This didn't seem to work, but running npm install does indeed remove the file. Probably something on my environment.

star-szr’s picture

Just to mention, not sure what process you followed but that code is in a postinstall "hook" (not sure if that's actually what they call it in nodeland), so it's not run when do npm update, only npm install.