Repository navigation
path.replace is not a function #360
Description
Activity
I cannot reproduce on Linux; so I'll need you to help me debug this.
If you edit
node_modules\postcss-cli\index.jsline 64 to readconsole.warn(input)and run again, what is the output?Lines 61 to 67 in 453aaec
if (argv.watch && !(argv.output || argv.replace || argv.dir)) { error('Cannot write to stdout in watch mode') } if (input && input.length) { return globber(input.map(slash), { dot: argv.includeDotfiles }) } This is the output that I have got after following your instructions.
[ 10, "versions'", 'css/style.concat.css' ]
TypeError: path.replace is not a function
at module.exports (G:\sass_course_projects\Natours_Media_Queries\node_modules\slash\index.js:10:14)
at Array.map ()
at G:\sass_course_projects\Natours_Media_Queries\node_modules\postcss-cli\index.js:66:28
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! natours@1.0.0 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 natours@1.0.0 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\ACER\AppData\Roaming\npm-cache_logs\2020-12-03T16_10_37_158Z-debug.logMy bad, I should have seen that from just looking at your initial post. Your problem is that you're using single quotes around
last 10 versions. Windows doesn't recognize single quotes as quotes on the command line; using double-quotes should make it work.Also, you'll want to delete
node_modulesand reinstall to undo the changes I requested.Note to self: perhaps should cast to string before running through slash to give a more intelligent error message in this case.
It works when I Replaced single quotes with doubles quotes with escape characters as mentioned by you. Thank you so much for the solution.
Reacted by Ryan Zimmerman- added a commit that references this issue
on Dec 3, 2020 - added a commit that references this issue
on Jun 9, 2025 - added a commit that references this issue
on Sep 28, 2026
When I try to to prefix a css using the command
postcss --use autoprefixer -b 'last 10 versions' style.concat.css -o css/style.prefix.css, it throws following error.given below is the debug log file content
Details