Create a fresh Drupal 10 project.
Two options, Download Drupal 10 directly: https://www.drupal.org/project/drupal/releases/10.0.0
Alternatively, use Composer https://www.drupal.org/docs/develop/using-composer/manage-dependencies
If you have composer globally:
Code Block composer create-project drupal/recommended-project my_site_name_dir
If you want a different version, add the version number to the command after a colon. For example, to download version 9.3.12:
Code Block composer create-project drupal/recommended-project:9.3.12 my_site_name_dir
Create a new, custom Drupal Theme.
Run this command from your project’s root:
Code Block php core/scripts/drupal generate-theme my_new_theme
Change
my_new_theme
to an appropriate name for your project.
Otherwise, download or create your own them from scratch.
Update composer.json file, in project root.
Ensure to include
drush
if you would like to use it -"drush/drush": "^11.4"
. You can also runcomposer require drush/drush
Create a package.json file, in theme root.
Add what you need
Run the following, suggested commands
npm cache clean --force
nvm ls
Prints the node versions installed on your machine & the current node version you're using.nvm use 16
npm install
If updating an existing project
npm uninstall node-sass
npm install sass
npm cache clean --force
Create a Lando, or DDev project.
Start the project.
Issues with changing site version to 10 - changing Node to version 16 - using (node) SASS:
Actions for theme:
rm -r node_modules
This will remove the node_modules folder in your repository. If you are using Webpack, you can also remove thedist
folder usingrm -r dist
and re-build your repository.npm cache clean --force
nvm ls
- Prints the node versions installed on your machine & the current node version you're using.nvm use 16
npm uninstall node-sass
npm install sass
or …npm install node-sass@npm:sass
https://www.npmjs.com/package/node-sass/v/7.0.1 vs https://www.npmjs.com/package/sassnpm install
...