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

Object.assign breaks when used with lerna #12

Closed
tylerfowle opened this issue Jan 10, 2019 · 2 comments
Closed

Object.assign breaks when used with lerna #12

tylerfowle opened this issue Jan 10, 2019 · 2 comments

Comments

@tylerfowle
Copy link

opts = Object.assign({cwd: process.cwd()}, opts);

TypeError: Expected cwd to be of type string but received type undefined

I'm running into this error while using postcss-cli with lerna to run an autoprefixer tasks.
"autoprefixer": "../../node_modules/.bin/postcss --use autoprefixer -r css/stylesheet.css --scripts-prepend-node-path"

ive changed this:
opts = Object.assign({cwd: process.cwd()}, opts);

to this:
opts.cwd = process.cwd();

as a work around.

full error:

npm WARN lifecycle The node binary used for scripts is /var/folders/pt/w9xns7l93zxbg9d9lxrx2jsrvbj7pq/T/yarn--1547151123573-0.09679202688283062/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
TypeError: Expected `cwd` to be of type `string` but received type `undefined`
    at module.exports (/Users/..../node_modules/dir-glob/index.js:52:25)
    at globDirs (/Users/..../node_modules/globby/index.js:58:10)
    at getPattern (/Users/..../node_modules/globby/index.js:61:64)
    at Promise.all.globTasks.map.task (/Users/..../node_modules/globby/index.js:72:70)
    at Array.map (<anonymous>)
    at module.exports (/Users/..../node_modules/globby/index.js:72:42)
    at Promise.resolve.then (/Users/..../node_modules/postcss-cli/index.js:58:14)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)```
@dhruv-m-patel
Copy link

I get the exact same error as this, but I'm not using lerna.

Noticed that there was a PR that was closed in favor of a change in globby which I don't think is reflecting yet and is causing this issue.

@kevva
Copy link
Owner

kevva commented Jan 14, 2019

Duplicate of #10.

@tylerfowle, see postcss/postcss-cli#265.

@dhruv-m-patel, it should be fixed in [email protected].

@kevva kevva closed this as completed Jan 14, 2019
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

3 participants