Error message upon running the bash command/script create-new-vartheme-bs4.sh Missing write access to /usr/lib/node_modules

Created on 18 October 2020, over 3 years ago
Updated 16 January 2023, over 1 year ago

After updating my Varbase installation to the latest version 8.8.7 (from 8.8.5) I tried to create new varthemebs4_subtheme (assuming there were uptates to subtheme in 8.8.7 Varbase version.

I ran the following commands

cd PROJECT_DIR_NAME/docroot/themes/contrib/vartheme_bs4/scripts
bash ./create-new-vartheme-bs4.sh "THEME_NAME"

I get the following error message upon running the bash command/script as above. The theme does get ceated but the node_modules do not get downloaded. The whole node_modules folder is missing. I am not sure if there would be any more errors apart from this.

It is complaing about write access to /usr/lib/node_modules. /usr/lib/node_modules is owned by root. Why would the script when run in a project (as a project owner) would try to access folder owned by root This was not the case in previous versions of varbase and themes created successfull in previous versions of Varbase.

bash ./create-new-vartheme-bs4.sh "THEME_NAME"
Current path: /home/<username>/public_html/docroot/themes/contrib/vartheme_bs4/scripts
Drupal root: /home/,username>/public_html/docroot
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/<username>.npm/_logs/2020-10-18T19_07_36_828Z-debug.log
ERROR: [Errno 2] No such file or directory: 'install'
---------------------------------------------------------------------------
   The new Vartheme BS4 Sub-Theme were created at "/home/<username>/public_html/docroot/themes/custom/THEME_NAME :)" 
---------------------------------------------------------------------------

Apart from the above bash script to create new vartheme_bs4 sub-theme, what does the following code do in relation to new sub-theme generation. Does the below mentioned yarn command is an alternative to the above bash script and one can run either. Or running yarn command is better than bash command or we need to run both. github page is not creall about it. Please advice.

$ cd PROJECT_DIR_NAME/docroot/themes/contrib/vartheme_bs4
yarn theme:create-sub-theme "THEME_NAME"
πŸ› Bug report
Status

Closed: outdated

Version

9.0

Component

Documentation

Created by

πŸ‡¬πŸ‡§United Kingdom aanjaneyam

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024