Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a fresh Drupal 10 project.

    1. Two options, Download Drupal 10 directly: https://www.drupal.org/project/drupal/releases/10.0.0

    2. Alternatively, use Composer https://www.drupal.org/docs/develop/using-composer/manage-dependencies

      1. 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 Blockcomposer create-project drupal/recommended-project:9.3.12
      2. Change my_site_name_dir to an appropriate name for your project.

  2. Create a new, custom Drupal Theme.

    1. Run this command from your project’s root:

      Code Block
      php core/scripts/drupal generate-theme my_new_theme
      1. Change my_new_theme to an appropriate name for your project.

    2. Otherwise, download or create your own them theme from scratch.

  3. Update composer.json file, in project root.

    1. Ensure to include drush if you would like to use it - "drush/drush": "^11.4" . You can also run composer require drush/drush

  4. Create a package.json file, in theme root.

    1. Add what you need. Here’s a helpful example with explanation: https://www.hook42.com/blog/nodejs-version-control-drupal-themes

    2. Run the following, suggested commands:

      1. npm cache clean --force

      2. nvm ls
        Prints the node versions installed on your machine & the current node version you're using.

      3. nvm use 16

      4. npm installIf updating an existing project

      5. npm

        uninstall node-sass
      6. npm install sass

      7. npm cache clean --force

  5. Create a Lando, or DDev project.

    1. https://docs.drupalcommerce.org/commerce2/developer-guide/install-update/quick-start

    2. https://ddev.readthedocs.io/en/latest/users/quickstart/#craft-cms

    3. https://stackoverflow.com/questions/49785023/how-can-i-create-and-load-a-second-database-in-ddev

  6. Start the project.

Issues with changing site version to 10 - changing Node to version 16 - using (node) SASS:

...

    1. If you run into a problem, and want to try again:

      1. rm -r node_modules
        This will remove the node_modules folder in your repository. If you are using Webpack, you can also remove the dist folder using rm -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

    1. If you are updating an existing Node 14 project, that uses npm node-sass, you will need to make a few changes before updating to Node 16 and npm sass.

      1. What is the difference? Read these first - https://www.npmjs.com/package/node-sass/v/7.0.1 vs https://www.npmjs.com/package/sass

...

npm install

      1. Node-Sass
        Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.

        Are you running a M1 mac? ARM64 isn't supported by any version of node-sass right now.

...

        • If you try to run npm install will error out.

...

        • Instead, run these first while also reviewing from the start of this section:

          • npm uninstall node-sass

          • npm install sass or npm i sass --save or npm install node-sass@npm:sass

  1. Create a Lando, or DDev project.

    1. https://

...

    1. docs.

...

    1. drupalcommerce.org/

...

    1. commerce2/

...

    1. developer-guide/install-update/quick-start

    2. https://

...

    1. ddev.

...

    1. readthedocs.

...

    1. io/en/

...

    1. latest/

...

    1. users/

...

    1. quickstart/

...

    1. #craft-cms

    2. https://

...

    1. stackoverflow.

...

    1. com/

...

    1. questions/49785023/how-can-i-create-and-load-a-second-database-in-ddev

  1. Start the project.

...

Potential warning or errors known with changing site version to 10 - changing Node to version 16 - using (node) SASS:

...

...

...

...

...

...

...

...

...

...

Separate issues ?

...

...

...

Helpful Additional, helpful links:

https://blog.logrocket.com/how-switch-node-js-versions-nvm/

...