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

Expected cwd to be of type string but received type undefined #264

Closed
Marzdor opened this issue Jan 11, 2019 · 6 comments
Closed

Expected cwd to be of type string but received type undefined #264

Marzdor opened this issue Jan 11, 2019 · 6 comments

Comments

@Marzdor
Copy link

Marzdor commented Jan 11, 2019

I've been using the same script and config for my postcss now all of a sudden like maybe 30min ago I always get this error and I am not sure why.

"postcss": "postcss --config postcss.config.js -w src/css/main.css -o src/css/index.css"

/// config
module.exports = () => ({
  plugins: {
    autoprefixer: {
      browsers: "> 5%"
    },
    "postcss-import": {},
    "postcss-mixins": {},
    "postcss-nested": {},
    "postcss-simple-vars": {}
  }
});

$ npm run postcss

> [email protected] postcss A:\Documents\web\brodericks-compendium
> npm run postcss --prefix client

> [email protected] postcss A:\Documents\web\brodericks-compendium\client
> postcss --config postcss.config.js -w src/css/main.css -o src/css/index.css

TypeError: Expected `cwd` to be of type `string` but received type `undefined`
    at module.exports (A:\Documents\web\brodericks-compendium\client\node_modules\dir-glob\index.js:44:25)
    at globDirs (A:\Documents\web\brodericks-compendium\client\node_modules\globby\index.js:58:9)
    at getPattern (A:\Documents\web\brodericks-compendium\client\node_modules\globby\index.js:61:64)
    at Promise.all.globTasks.map.task (A:\Documents\web\brodericks-compendium\client\node_modules\globby\index.js:72:69)
    at Array.map (<anonymous>)
    at module.exports (A:\Documents\web\brodericks-compendium\client\node_modules\globby\index.js:72:41)
    at Promise.resolve.then (A:\Documents\web\brodericks-compendium\client\node_modules\postcss-cli\index.js:58:14)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postcss: `postcss --config postcss.config.js -w src/css/main.css -o src/css/index.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postcss 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\Marzdor\AppData\Roaming\npm-cache\_logs\2019-01-11T01_35_10_036Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postcss: `npm run postcss --prefix client`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postcss script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@RyanZim
Copy link
Collaborator

RyanZim commented Jan 11, 2019

Not sure, there was a bug in our underlying glob library, try doing a fresh install.

@Marzdor
Copy link
Author

Marzdor commented Jan 11, 2019

I have tried doing a fresh install even deleted all local files and cloned my repo still getting the same error. And the script seems to still work in my other project just not this one.

@Marzdor
Copy link
Author

Marzdor commented Jan 11, 2019

Not sure exactly what was causing it but I think I did something with my files. I manage to fix it by taking my other project as my base and slowly replacing the files with the ones from the project that was giving me this error.

@Marzdor Marzdor closed this as completed Jan 11, 2019
@RyanZim
Copy link
Collaborator

RyanZim commented Jan 11, 2019

Please make a reduced test case repo.

@Marzdor
Copy link
Author

Marzdor commented Jan 11, 2019

Never done that before nor am I entirely sure what it is.

@RyanZim
Copy link
Collaborator

RyanZim commented Jan 11, 2019

@Marzdor If you've managed to fix it on your end; no need, I somehow failed to see you'd commented and closed the issue.

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