When I run the npm install command under drupal 10 custom theme folder

66 Views Asked by At

When I run the npm install command under drupal custom theme folder I am using Drupal 10 version (https://i.stack.imgur.com/WnN2e.png)](https://i.stack.imgur.com/WnN2e.png)

tried with deleting package-lock.json file and run this npm cache clean --force I am getting that issue Which i have added in that screenshot

1

There are 1 best solutions below

1
On

Ah the wonderful world of Drupal themes, where you go to NPM install to make one small change and the entire front end setup is outdated / broken / won't install.

node-gyp errors are often caused by incompatible node versions, so perhaps if this is an old theme you have newer node versions installed causing an issue.

When people get a node-gyp error one of:

  • Deleting node-modules
  • Deleting ~/.node-gyp
  • Removing HOME/.node-gyp
  • Restarting machine
  • Changing node version

Can get it to run.

Alternatively, if this is an old theme, it may be worth keeping your local setup with the latest node installed, and instead look to upgrade any build tools - gulp, sass etc re-writing certain things where required.