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

Fails to write output to file if containing directory does not yet exist #36

Closed
edeych opened this issue Aug 2, 2019 · 1 comment
Closed

Comments

@edeych
Copy link

edeych commented Aug 2, 2019

If I try to output to a file in a target directory but that directory does not yet exist, the system throws an error. This does not happen if I use grunt-contrib-cssmin - it creates the missing directory structure for me, but I no longer want to use grunt. Here is the stack trace on a Windows 10 OS:

Error: ENOENT: no such file or directory, open 'C:\Users\Human\Documents\GitHub\crucial\public\dist\1.0.0\css\main.min.css' at Object.fs.openSync (fs.js:646:18) at Object.fs.writeFileSync (fs.js:1299:33) at output (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css-cli\index.js:323:8) at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css-cli\index.js:266:7 at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\clean.js:125:9 at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\read-sources.js:26:64 at loadOriginalSources (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\load-original-sources.js:26:5) at C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\read-sources.js:26:14 at applySourceMaps (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\apply-source-maps.js:34:5) at Object.callback (C:\Users\Human\Documents\GitHub\crucial\node_modules\clean-css\lib\reader\read-sources.js:25:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] cleancss: cleancss -o public/dist/%npm_package_version%/css/main.min.css public/css/*.css npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] cleancss script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@jakubpawlowicz
Copy link
Collaborator

It's fixed in main branch and due in v5.0.0 soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants