Insomnia: [Bug] Plugin dependencies' dependencies not installed correctly

Created on 26 Jul 2019  ยท  6Comments  ยท  Source: Kong/insomnia

  • Insomnia Version: 6.5.4
  • Operating System: Windows 10 Pro, 1903

Details

I installed insomnia-plugin-regex via the _Preferences/Plugins_ tab without issue, but ran into issues when installing the insomnia-plugin-os plugin. It complains that it cannot fine the esprima module. I tracked down the dependencies of insomnia-plugin-os (LINK), which is the NPM module jsonpath. I then tracked down the dependencies of jsonpath (LINK), which finally revealed the esprima dependency (along with 2 others).

Error output below:

insomnia-plugin-os install error: Command failed: "C:\Users\user\AppData\Local\insomnia\app-6.5.4\Insomnia.exe" --no-deprecation C:\Users\user\AppData\Local\insomnia\app-6.5.4resources\bin\yarn-standalone.js add insomnia-plugin-os --modules-folder C:\Users\user\AppData\Local\Temp\insomnia_6.5.4\insomnia-plugin-os-1564098003065 --cwd C:\Users\user\AppData\Local\Temp\insomnia_6.5.4\insomnia-plugin-os-1564098003065 --no-lockfile --production --no-progress
error C:\Users\user\AppData\Local\Temp\insomnia_6.5.4\insomnia-plugin-os-1564098003065\jsonpath: Command failed.
Exit code: 1
Command: node lib/aesprim.js > generated/aesprim-browser.js
Arguments:
Directory: C:\Users\user\AppData\Local\Temp\insomnia_6.5.4\insomnia-plugin-os-1564098003065\jsonpath
Output:
internal/modules/cjs/loader.js:604
throw err;
^
Error: Cannot find module 'esprima'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.resolve (internal/modules/cjs/helpers.js:30:19)
at Object. (C:\Users\user\AppData\Local\Temp\insomnia_6.5.4\insomnia-plugin-os-1564098003065\jsonpath\lib\aesprim.js:4:20)
at Object. (C:\Users\user\AppData\Local\Temp\insomnia_6.5.4\insomnia-plugin-os-1564098003065\jsonpath\lib\aesprim.js:20:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:753:10)

areplugin-api help wanted

Most helpful comment

When I run npm install insomnia-plugin-os in my ~/Library/Application Support/Insomnia/plugins directory, nothing happens. Well, something happens, but nothing _useful_. To wit:

โžœ npm install insomnia-plugin-os
npm WARN saveError ENOENT: no such file or directory, open '/Users/austin/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/austin/package.json'
npm WARN austin No description
npm WARN austin No repository field.
npm WARN austin No README data
npm WARN austin No license field.

+ [email protected]
updated 1 package and audited 100 packages in 0.741s
found 0 vulnerabilities

It creates a ~/package-lock.json and ~/node_modules, but does not otherwise do anything to the plugins/ directory.

All 6 comments

๐Ÿ‘‹ Thanks for opening your first issue! If you're reporting a ๐Ÿž bug, please make sure
you include steps to reproduce it. If you're requesting a feature ๐ŸŽ, please provide real
use cases that would benefit. ๐Ÿ‘ช

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

Hmm, that's strange, I get the same error on macOS. I have a feeling it's maybe a limitation of using the bundled version of Yarn within Insomnia. You can get around this for now by manually running the install command within the plugins folder:

npm install insomnia-plugin-os

When I run npm install insomnia-plugin-os in my ~/Library/Application Support/Insomnia/plugins directory, nothing happens. Well, something happens, but nothing _useful_. To wit:

โžœ npm install insomnia-plugin-os
npm WARN saveError ENOENT: no such file or directory, open '/Users/austin/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/austin/package.json'
npm WARN austin No description
npm WARN austin No repository field.
npm WARN austin No README data
npm WARN austin No license field.

+ [email protected]
updated 1 package and audited 100 packages in 0.741s
found 0 vulnerabilities

It creates a ~/package-lock.json and ~/node_modules, but does not otherwise do anything to the plugins/ directory.

Same problem here.

`Failed to install insomnia-plugin-os

There may be an issue with the plugin itself, as a note you can discover and install plugins from the Plugin Hub.
Additionl Information
Error: insomnia-plugin-os install error: Command failed: /opt/Insomnia/insomnia.bin --no-deprecation /opt/Insomnia/resources/bin/yarn-standalone.js add insomnia-plugin-os --modules-folder /tmp/insomnia_2020.3.3/insomnia-plugin-os-1600654257796 --cwd /tmp/insomnia_2020.3.3/insomnia-plugin-os-1600654257796 --no-lockfile --production --no-progress
error /tmp/insomnia_2020.3.3/insomnia-plugin-os-1600654257796/jsonpath: Command failed.
Exit code: 1
Command: node lib/aesprim.js > generated/aesprim-browser.js
Arguments:
Directory: /tmp/insomnia_2020.3.3/insomnia-plugin-os-1600654257796/jsonpath
Output:
internal/modules/cjs/loader.js:604
throw err;
^

Error: Cannot find module 'esprima'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
at Function.resolve (internal/modules/cjs/helpers.js:30:19)
at Object. (/tmp/insomnia_2020.3.3/insomnia-plugin-os-1600654257796/jsonpath/lib/aesprim.js:4:20)
at Object. (/tmp/insomnia_2020.3.3/insomnia-plugin-os-1600654257796/jsonpath/lib/aesprim.js:20:3)
at Module._compile (internal/modules/cjs/loader.js:711:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
at Function.Module._load (internal/modules/cjs/loader.js:551:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:753:10)

at child_process__WEBPACK_IMPORTED_MODULE_3___default.a.execFile (file:///opt/Insomnia/resources/app.asar/bundle.js:94559:16)
at ChildProcess.exithandler (child_process.js:310:5)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close [as _onclose] (net.js:596:12)`

but does not otherwise do anything to the plugins/ directory.

If you run npm install insomnia-plugin-os within the /plugins directory, then go into the plugins list within Insomnia and hit "Reload Plugins", this should work. I was able to reproduce the installation error on macOS (it should be looked at and fixed), but I was also able to install it directly into the directory as a workaround for now.

but does not otherwise do anything to the plugins/ directory.

If you run npm install insomnia-plugin-os within the /plugins directory, then go into the plugins list within Insomnia and hit "Reload Plugins", this should work. I was able to reproduce the installation error on macOS (it should be looked at and fixed), but I was also able to install it directly into the directory as a workaround for now.

Worked, Thank you so much. $ ~/.config/Insomnia/plugins

Was this page helpful?
0 / 5 - 0 ratings