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

PooshError: Unable to resolve plugin "poosh-plugin-s3" (Windows) #1

Closed
Jubijub opened this issue Apr 24, 2016 · 9 comments
Closed

PooshError: Unable to resolve plugin "poosh-plugin-s3" (Windows) #1

Jubijub opened this issue Apr 24, 2016 · 9 comments
Assignees
Labels

Comments

@Jubijub
Copy link

Jubijub commented Apr 24, 2016

Fresh install on windows 10 64 :

  • Node.js 5.11.0 x64
  • NPM 3.8.6
  • Poosh installed via npm install -g poosh-cli poosh-plugin-s3 with no apparent issue

I use the following poosh config, which apart from the remote, is the same as the example
I tried both with plugins : ["s3"] and the config below

{
  plugins : ["poosh-plugin-s3"],
  baseDir : ".",
  remote  : "s3-website.eu-central-1.amazonaws.com/xxxxxxxxxx",

  each: [{
    headers   : { "cache-control": { cacheable: "public" } }
  }, {
    match     : "**/*.{html,css,js}",
    gzip      : true,
    headers   : { "cache-control": { maxAge: "48 hours" } }
  }, {
    match     : "**/*.{jpg,png,gif,ico}",
    gzip      : false,
    headers   : { "cache-control": { maxAge: "6 months" } }
  }, {
    match     : "**/*.html",
    priority  : -1
  }]
}

Actual result :

D:\OneDrive\Projects\MailingMariage\site>poosh
PooshError: Unable to resolve plugin "s3" within "D:\OneDrive\Projects\MailingMariage\site".
    at resolvePlugin (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:73:11)
    at PluginCollection.addSingle (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:105:16)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:175:26
    at Array.forEach (native)
    at PluginCollection.add (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:174:13)
    at OptionManager.addOptions (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:121:21)
    at OptionManager.addConfigFile (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:163:12)
    at _callee$ (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:67:60)
    at tryCatch (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:61:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:329:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:94:21)
    at step (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:191)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:451
    at new Promise (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\core-js\modules\es6.promise.js:193:7)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:99
    at main (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:114:16)

D:\OneDrive\Projects\MailingMariage\site>poosh
PooshError: Unable to resolve plugin "s3" within "D:\OneDrive\Projects\MailingMariage\site".
    at resolvePlugin (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:73:11)
    at PluginCollection.addSingle (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:105:16)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:175:26
    at Array.forEach (native)
    at PluginCollection.add (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:174:13)
    at OptionManager.addOptions (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:121:21)
    at OptionManager.addConfigFile (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:163:12)
    at _callee$ (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:67:60)
    at tryCatch (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:61:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:329:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:94:21)
    at step (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:191)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:451
    at new Promise (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\core-js\modules\es6.promise.js:193:7)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:99
    at main (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:114:16)

D:\OneDrive\Projects\MailingMariage\site>poosh plugins
PooshError: Unable to resolve plugin "s3" within "D:\OneDrive\Projects\MailingMariage\site".
    at resolvePlugin (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:73:11)
    at PluginCollection.addSingle (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:105:16)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:175:26
    at Array.forEach (native)
    at PluginCollection.add (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:174:13)
    at OptionManager.addOptions (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:121:21)
    at OptionManager.addConfigFile (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:163:12)
    at _callee$ (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:67:60)
    at tryCatch (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:61:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:329:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:94:21)
    at step (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:191)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:451
    at new Promise (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\core-js\modules\es6.promise.js:193:7)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:99
    at main (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:114:16)

D:\OneDrive\Projects\MailingMariage\site>poosh
PooshError: Unable to resolve plugin "poosh-plugin-s3" within "D:\OneDrive\Projects\MailingMariage\site".
    at resolvePlugin (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:73:11)
    at PluginCollection.addSingle (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:105:16)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:175:26
    at Array.forEach (native)
    at PluginCollection.add (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\helpers\options\PluginCollection.js:174:13)
    at OptionManager.addOptions (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:121:21)
    at OptionManager.addConfigFile (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\poosh-core\lib\OptionManager.js:163:12)
    at _callee$ (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:67:60)
    at tryCatch (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:61:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:329:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\babel-regenerator-runtime\runtime.js:94:21)
    at step (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:191)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:451
    at new Promise (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\node_modules\core-js\modules\es6.promise.js:193:7)
    at C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:25:99
    at main (C:\Users\jubij\AppData\Roaming\npm\node_modules\poosh-cli\lib\main.js:114:16)
@yvele yvele added the bug label Apr 24, 2016
@yvele yvele self-assigned this Apr 24, 2016
@yvele
Copy link
Owner

yvele commented Apr 24, 2016

Thanks @Jubijub for the bug report 😬

I'm not quite sure but poosh uses a package resolution mechanism that can reach global packages (for the s3 plugin). This mechanism has not been tested on Windows and it looks like it fails:

PooshError: Unable to resolve plugin "s3" within "D:\OneDrive\Projects\MailingMariage\site".

I need to investigate a little bit...

Possible Workaround

  1. Install poosh-cli globally using npm install -g poosh-cli
  2. Install the S3 plugin locally in your working directory using npm install poosh-plugin-s3

Local installation of S3 plugin will create a node_module folder in your working directory, that's why I suggest you to put your static website content inside a dedicated directory:

D:\OneDrive\Projects\MailingMariage\site\
|-- node_modules\
|-- content\
| `-- foo.html
| `-- bar.jpg
|-- .poosh.json5
|-- .poosh.cache

and use baseDir : "./content" in your config file.

@yvele
Copy link
Owner

yvele commented Apr 24, 2016

I would like to know your global path prefix, can you run npm config get prefix and get me the result?
I also would like to know if you are using NVM

@yvele yvele changed the title PooshError: Unable to resolve plugin "poosh-plugin-s3" PooshError: Unable to resolve plugin "poosh-plugin-s3" (Windows 10) Apr 24, 2016
@Jubijub
Copy link
Author

Jubijub commented Apr 24, 2016

C:\Users\jubij>npm config get prefix
C:\Users\jubij\AppData\Roaming\npm

This is a fairly typical place to store this kind of things for Windows

I don't use NVM (this is a fresh install of node (it was not installed on this computer before), and poosh and relates modules are the only non-default modules installed

@yvele
Copy link
Owner

yvele commented Apr 24, 2016

@Jubijub Cool thanks..
What's inside AppData\Roaming\npm ? Can you find both

C:\Users\jubij\AppData\Roaming\npm\lib\node_modules\poosh-cli\
C:\Users\jubij\AppData\Roaming\npm\lib\node_modules\poosh-plugin-s3\

Maybe the bug is only about \and / (source here should be fixed with path.join)

@Jubijub
Copy link
Author

Jubijub commented Apr 24, 2016

I have both, on the path given above, and both directories are populated
I have poosh and poosh.cmd in C:\Users\jubij\AppData\Roaming\npm

@yvele yvele changed the title PooshError: Unable to resolve plugin "poosh-plugin-s3" (Windows 10) PooshError: Unable to resolve plugin "poosh-plugin-s3" (Windows) Apr 24, 2016
@yvele
Copy link
Owner

yvele commented Apr 24, 2016

I used path.join in this commit
And here you have a new 1.0.5 release: https://github.com/yvele/poosh/releases/tag/v1.0.5

I haven't yet tested it on Windows.. but I think it's gonna be ok.. Let me know @Jubijub 🙃

@yvele yvele closed this as completed Apr 24, 2016
@yvele yvele reopened this Apr 26, 2016
@yvele
Copy link
Owner

yvele commented Apr 26, 2016

I finally managed to test installation on Windows.. and it's still not working because I forgot that:

Global installs on Unix systems go to {prefix}/lib/node_modules. Global installs on Windows go to {prefix}/node_modules (that is, no lib folder.)

Source: https://docs.npmjs.com/files/folders#node-modules

@yvele
Copy link
Owner

yvele commented Apr 26, 2016

Now everything is finally fixed to be portable on Windows in v1.0.6 Release.

@yvele yvele closed this as completed Apr 26, 2016
@Jubijub
Copy link
Author

Jubijub commented May 1, 2016

Confirmed, it's fixed

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

No branches or pull requests

2 participants