Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glob pattern string required #34

Closed
maliyshock opened this issue Jul 31, 2016 · 12 comments
Closed

glob pattern string required #34

maliyshock opened this issue Jul 31, 2016 · 12 comments

Comments

@maliyshock
Copy link

Hey everyone. Have this issue on my windows system. This issue does not apper on nix - based systems.

I`ve installed postcss and postcss-cli, cause i need to run npm scripts from terminal.
So, my package.json looks like this http://joxi.ru/4AkvbE1fMzeaj2
U can see the error on screenshot higher.
When i remove this part "| postcss --use autoprefixer --autoprefixer.browsers 'last 2 versions'" - all is work fine, but without autoprefixier - so this is sad. Can u help me with that?

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 10, 2016

I can't see your screenshot. Can you paste your package.json here?

@maliyshock
Copy link
Author

https://github.com/maliyshock/flexboxgrid

package json from this repo

@maliyshock
Copy link
Author

{
"name": "flexboxgrid",
"version": "1.0.0",
"description": "Flexbox Grid\r ===========",
"main": "index.js",
"dependencies": {
"autoprefixer": "^6.3.7",
"clean-css": "^3.4.19",
"node-sass": "^3.8.0",
"postcss": "^5.1.0",
"postcss-cli": "^2.5.2"
},
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"sass": "npm run sass:compile && npm run sass:min",
"sass:compile": "node-sass dev/scss/index.scss | postcss --use autoprefixer --autoprefixer.browsers 'last 2 versions' > dev/css/my-flex-box-grid.css",
"sass:min": "cleancss dev/css/my-flex-box-grid.css > dev/css/my-flex-box-grid.min.css"
},
"repository": {
"type": "git",
"url": "git+https://github.com/maliyshock/flexboxgrid.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/maliyshock/flexboxgrid/issues"
},
"homepage": "https://github.com/maliyshock/flexboxgrid#readme"
}

@maliyshock
Copy link
Author

On mac - all works fine. The proplem exist on windows, may be this is particular case

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 18, 2016

OK, I think the issue is at https://github.com/postcss/postcss-cli/blob/master/index.js#L87. postcss-cli calls globby even if there are no files specified. In your case, you passing the css through stdin, and for some reason that causes an error.

If my hunch is correct, this is a bug (though I can't test on windows; it works on linux). I'll try to make a patch soon.

CC: @watilde @pirxpilot

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 18, 2016

@maliyshock OK, try this:

In your repository, run:

npm uninstall postcss-cli
npm install ryanzim/postcss-cli#3951bd28676ba02d80d45e64cf6240e04f15a9aa

Try running your script again and see if it throws an error. Report your findings here.

Delete node_modules and run npm install to get your project back to where you started.

@maliyshock
Copy link
Author

Thanks. So i have bought a mac, and now i have no any problems with that bug))

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 18, 2016

@maliyshock Can you close this? Thanks!

@cxcorp
Copy link

cxcorp commented May 5, 2017

Issue is still present in postcss-cli 3.2.0 on Windows 7 x64, node v7.10.0:

> postcss --use autoprefixer --autoprefixer.browsers 'last 2 versions, IE >= 10, iOS >= 7' --output generated/styles/main.css generated/styles/main.css

TypeError: patterns must be a string or an array of strings
    at assertPatternsInput (C:\Users\xxx\Documents\Software\yyy\node_modules\postcss-cli\node_modules\globby\index.js:20:9)
    at generateGlobTasks (C:\Users\xxx\Documents\Software\yyy\node_modules\postcss-cli\node_modules\globby\index.js:26:2)
    at module.exports (C:\Users\xxx\Documents\Software\yyy\node_modules\postcss-cli\node_modules\globby\index.js:62:15)
    at Promise.resolve.then (C:\Users\xxx\Documents\Software\yyy\node_modules\postcss-cli\index.js:170:39)
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:607:11)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

@RyanZim
Copy link
Collaborator

RyanZim commented May 5, 2017

--autoprefixer.browsers options are not supported in v3. Also, please place your input filename first in the command.

@42x42x42
Copy link

42x42x42 commented May 24, 2018

have the same problem on windows 7 x64
How to solve it?

`{
"name": "LP",
"version": "1.0.0",
"description": "landing page",
"main": "index.js",
"scripts": {
"watch:sass": "node-sass sass/main.scss css/style.css -w",
"compile:sass": "node-sass sass/main.scss css/style.comp.css",
"concat:css": "concat -o css/style.concat.css css/style.comp.css css/icon-font.css",
"prefix:css": "postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css"
},
"author": "42",
"license": "ISC",
"devDependencies": {

"autoprefixer": "^8.5.0",
"concat": "^1.0.3",
"node-sass": "^4.9.0",
"postcss-cli": "^5.0.0"

}

}
`

@RyanZim
Copy link
Collaborator

RyanZim commented May 24, 2018

Use a config file.

@postcss postcss locked as resolved and limited conversation to collaborators May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants