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

does not work when compiling locally #172

Closed
azusa-tomita opened this issue Jan 30, 2019 · 1 comment
Closed

does not work when compiling locally #172

azusa-tomita opened this issue Jan 30, 2019 · 1 comment

Comments

@azusa-tomita
Copy link

Steps To Reproduce The Error

  1. git clone https://github.com/JamieMason/ImageOptim-CLI.git.
  2. npm insatall
  3. npm pack
  4. npm install -g ./imageoptim-cli-2.3.4.tgz
  5. imageoptim ./test.png

Expected Behaviour

imageOptim.app will work and compress the image.

Actual Behaviour

Forcibly stop. The following error message is displayed.

/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:9489
		throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof opts.cwd}\``);
		^

TypeError: Expected `cwd` to be of type `string` but received type `undefined`
    at module.exports.sync (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:9489:9)
    at globDirs (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:17316:9)
    at getPattern (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:17319:64)
    at globTasks.reduce (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:17365:19)
    at Array.reduce (<anonymous>)
    at Function.module.exports.sync (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:17364:26)
    at Object.<anonymous> (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:72:28)
    at c (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:36190:3584)
    at Function.r.import (/Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:36190:4190)
    at /Users/hoge/.nvm/versions/node/v8.11.1/lib/node_modules/imageoptim-cli/dist/imageoptim:36187:15

Version Numbers or N/A

N/A

Help Needed

@JamieMason
Copy link
Owner

Thanks @azusa-tomita,
I've had this issue on a few projects – it needs an update to the globby dependency to fix it. I will release an update when I get some time, hopefully later today or tomorrow. In the meantime these steps should fix it for you.

  1. git clone https://github.com/JamieMason/ImageOptim-CLI.git.
  2. npm install
  3. npm install --save-dev globby
  4. npm pack
  5. npm install -g ./imageoptim-cli-2.3.4.tgz
  6. imageoptim ./test.png

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

No branches or pull requests

2 participants