The Autoprefixer script crashes with the error message: TypeError - Patterns can only be a string or an array of strings

After successfully installing autoprefixer and postcss-cli, I embarked on setting up a simple build process with NPM scripts using my command prompt and VS code. As someone with only 2 months of coding experience, I was following a tutorial on CSS/SASS topics to enhance my skills but debugging still remains a challenge for me. Despite completing the desired code, I encountered difficulties in compiling everything into a compressed style.css document due to issues with prefixing.

In an attempt to resolve this issue, I entered the command npm run prefix:css which triggered the script:

postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css

The output displayed:

TypeError: Patterns must be a string or an array of strings 
 at assertPatternsInput (C:\Users\mjpry\Desktop\advanced-css-course master\Natours\starter\node_modules\globby\index.js:17:9)
    at generateGlobTasks (C:\Users\mjpry\Desktop\advanced-css-course-master\Natours\starter\node_modules\globby\index.js:42:2)
    at module.exports (C:\Users\mjpry\Desktop\advanced-css-course-master\Natours\starter\node_modules\globby\index.js:116:20)
    at C:\Users\mjpry\Desktop\advanced-css-course-master\Natours\starter\node_modules\postcss-cli\index.js:59:14
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prefix:css: `postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prefix:css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mjpry\AppData\Roaming\npm-cache\_logs\2020-01-29T23_00_22_951Z-debug.log

Given my limited experience, I am unable to troubleshoot this error effectively. Although it appears to relate to Node_Modules, I am uncertain about the next steps to take. Any assistance would be greatly appreciated!

Screenshot of errors

Answer №1

For those utilizing windows (based on the paths provided), consider attempting the following solution:

postcss --use autoprefixer -b \"last 10 versions\" css/style.concat.css -o css/style.prefix.css

Source: https://github.com/npm/npm/issues/20048

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for locking the position of a table header and allowing only the table body to scroll

I have designed a table with tbody consisting of 2 tr elements. One tr is used for hiding/showing data. I am trying to keep the Table header fixed while only scrolling the table body. However, as I am using angular js ng-repeat on the tbody, I am encounte ...

What are the steps to make the chosen title and its content active while deactivating the others?

I am currently developing a website for an educational institution that includes schools with subdivisions such as matric, CBSE, and state board, as well as a college. My goal is to create a user interface where clicking on a specific stream (such as matri ...

Each attempt to install a new package results in a syntax error pointing to "gyp err"

While in the process of installing Firebase, I encountered a similar issue when attempting to install yarn add react-router-dom. To resolve this, I had to create a new project and manually copy over all the files again. What stood out to me was that this ...

Steps to bold a specific word within a div on react native

Hey there! I'm working with the code below: getDescription = () => { return( <div className="Description">{this.props.mytext + ': ' + this.name} </div> ) } Is it possible to bold only the specific te ...

Foundation 5 - ensure background-image covers the entire column width

I'm trying to achieve a unique layout using Zurb Foundation. My goal is to have two columns, each taking up half of the screen: <div class="small-6 columns"><!-- INSERT IMAGE HERE --></div> <div class="small-6 columns"> < ...

The challenge of incorporating mod_rewrite with CSS files

I am new to mod_rewrite. I have a page profiles.php?page=XXX and I tried to change its URL to something more friendly like /cars/XXX/ RewriteEngine on RewriteRule ^cars/([^/]+)/?$ profiles.php?page=$1 [L] The issue arises when including styles: <li ...

Automatically switch slides and pause the carousel after completing a loop using Bootstrap 5 Carousel

Seeking assistance with customizing the carousel functionality. There seems to be some issues, and I could use a hand in resolving them. Desired Carousel Functionality: Automatically start playing the carousel on page load, and once it reaches the end of ...

Guide to creating a continuous loop for CSS3 animation

I'm looking to create a setup that can play on repeat, but I'm not very familiar with jQuery. Can anyone lend a hand with this? Check out the DEMO here $('.title1').fadeIn('fast', function() { $('div').addClass ...

Can you explain the contrast between --save and --save-dev for package management in Node.js?

Can you explain the distinctions among: npm install [package_name] as well as: npm install [package_name] --save and: npm install [package_name] --save-dev What do these variations indicate? And how do the --save and -dev flags actually impact the insta ...

Turn off the perpetual active mode

I have a situation where a link maintains its active state after being dragged and released. This is causing an issue that I need to address. For example, you can see the problem here: http://jsfiddle.net/Ek43k/3/ <a href="javascript:void(0);" id="foo ...

Is there a way to set the size of my unique carousel design?

Having some trouble with my modal image carousel; the dimensions keep shifting for different image sizes. Image 1 Image 2 ...

Having issues with a drop-down in Bootstrap. Is there anyone who can assist in getting it to function

I recently implemented a drop-down menu on the top navigation of my website. However, after applying Bootstrap to one of my pages, the drop-down menu stopped functioning properly. Below is the code that was applied: <link href="https://cdn.jsd ...

Guide to setting up Aurelia UX version 0.4.0 using Aurelia CLI

I have been utilizing the features of aurelia-ux 0.3.0 for a while now and I really appreciate the concept behind it. However, with the recent update to aurelia-ux 0.4.0 and the shift to monorepo, I am a bit confused on how to go about installing and using ...

Unable to navigate to input field in Ionic app while focusing on input field on mobile device

Default phone feature: When an input is focused on a mobile device, it automatically scrolls to that input. Issue: This functionality is not working in my ionic app due to horizontal scrolling. Consequently, when I tap on an input, it does not scroll to i ...

What is the CSS code to extend the width or length of a form field?

I am working with a form field box that has the class CCPPDisplayTD. I am attempting to increase its length using CSS styling. What is the best way to achieve this using CSS? ...

conceal elements created with JQuery within an AJAX function

Is it possible to use jQuery and the $.ajax() method to submit a form, displaying only the result while hiding other elements on the page? I am looking to add a conditional in the Ajax method that will show the result if successful, hiding certain elements ...

The behavior of CSS position: sticky varies depending on whether the user is scrolling up or scrolling down

I am experiencing an issue in my Vue CLI app where a component with the position: sticky CSS property is being partially hidden under the top of the browser when scrolling down, but works correctly when scrolling up. This behavior is also observed on my Ga ...

Design all buttons, except for the two specific buttons

.button , button{ border:solid black 2px !important; } Using this code, I have added a border to all buttons. But now, I need to exclude the buttons "searchsubmit" and "single_add_to_cart_button" from having a border. How can I achieve that? ...

HTML / CSS / JavaScript Integrated Development Environment with Real-time Preview Window

As I've been exploring different options, I've noticed a small but impactful nuance. When working with jQuery or other UI tools, I really enjoy being able to see my changes instantly. While Adobe Dreamweaver's live view port offers this func ...

Does CSS include a shadow child operator?

Did you know that Google Chrome has a special feature called the shadow descendant combinator /deep/? This unique combinator allows for the selection of elements within shadow nodes. body div {...} // this doesn't target descendant divs inside shadow ...