grafana / jmeter-to-k6

Converts JMeter .jmx files to k6 JS code
Apache License 2.0
69 stars 22 forks source link

jmeter-to-k6@0.1.17 postinstall - Error: Cannot find module './dict' #16

Closed testanalyst closed 5 years ago

testanalyst commented 5 years ago

Dear All,

Very excited to learn k6. I installed on my windows machine and initiated .jmx conversion to k6 scripts. In the process as defined at https://github.com/loadimpact/jmeter-to-k6, I started the command execution and command stopped after informing this..

> jmeter-to-k6@0.1.17 postinstall C:\Users\sgarg\AppData\Roaming\npm\node_modules\jmeter-to-k6
> node scripts/bundle.js

Vendor built successfully!
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module './dict' from 'C:\Users\sgarg\AppData\Roaming\npm\node_modules\jmeter-to-k6\node_modules\jsonpath'
    at C:\Users\sgarg\AppData\Roaming\npm\node_modules\jmeter-to-k6\node_modules\browser-resolve\node_modules\resolve\lib\async.js:55:21
    at load (C:\Users\sgarg\AppData\Roaming\npm\node_modules\jmeter-to-k6\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\sgarg\AppData\Roaming\npm\node_modules\jmeter-to-k6\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\sgarg\AppData\Roaming\npm\node_modules\jmeter-to-k6\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jmeter-to-k6@0.1.17 postinstall: `node scripts/bundle.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jmeter-to-k6@0.1.17 postinstall 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\sgarg\AppData\Roaming\npm-cache\_logs\2019-06-03T07_49_47_573Z-debug.log

Log file and CMD data is attached for your reference. 2019-06-03T07_49_47_573Z-debug.log CMD_Print.txt

Thanks for your attention, help and directions as early as possible

ashadrahman commented 5 years ago

I'm also facing similar issue while installing jmeter-to-k6 on mac.

➜ ~ sudo npm install jmeter-to-k6 Password:

core-js@2.6.9 postinstall /Users/ashadrahman/node_modules/core-js node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

jsonpath@1.0.2 postinstall /Users/ashadrahman/node_modules/jsonpath node lib/aesprim.js > generated/aesprim-browser.js

jmeter-to-k6@0.1.17 postinstall /Users/ashadrahman/node_modules/jmeter-to-k6 node scripts/bundle.js

/Users/ashadrahman/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:45 throw err0 ^

Error: EACCES: permission denied, mkdir '/Users/ashadrahman/node_modules/jmeter-to-k6/vendor' at Object.mkdirSync (fs.js:753:3) at Object.mkdirsSync (/Users/ashadrahman/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9) at Object. (/Users/ashadrahman/node_modules/jmeter-to-k6/scripts/bundle.js:17:4) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) npm WARN enoent ENOENT: no such file or directory, open '/Users/ashadrahman/package.json' npm WARN ashadrahman No description npm WARN ashadrahman No repository field. npm WARN ashadrahman No README data npm WARN ashadrahman No license field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! jmeter-to-k6@0.1.17 postinstall: node scripts/bundle.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the jmeter-to-k6@0.1.17 postinstall 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! /Users/ashadrahman/.npm/_logs/2019-06-21T16_58_02_311Z-debug.log

rahulmr commented 5 years ago

These seems to be a very high priority issue. Could you please fix it? I am not able to use old versions as well. Checked on Linux and Windows 10, nothing works.

bookmoons commented 5 years ago

What error are you seeing @rahulmr? Also the one about ./dict?

redochka commented 5 years ago

@bookmoons the error is here below. ./dict is being referenced but is missing. Same error as OP.

npm install jmeter-to-k6

> core-js@2.6.9 postinstall /home/reda/dev/audit-dev/jmeter-to-k6/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> jsonpath@1.0.2 postinstall /home/reda/dev/audit-dev/jmeter-to-k6/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js

> jmeter-to-k6@0.1.17 postinstall /home/reda/dev/audit-dev/jmeter-to-k6/node_modules/jmeter-to-k6
> node scripts/bundle.js

Vendor built successfully!
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module './dict' from '/home/reda/dev/audit-dev/jmeter-to-k6/node_modules/jsonpath'
    at /home/reda/dev/audit-dev/jmeter-to-k6/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
    at load (/home/reda/dev/audit-dev/jmeter-to-k6/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/reda/dev/audit-dev/jmeter-to-k6/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /home/reda/dev/audit-dev/jmeter-to-k6/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)
npm WARN my-jmeter-to-k6@1.0.0 No description
npm WARN my-jmeter-to-k6@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jmeter-to-k6@0.1.17 postinstall: `node scripts/bundle.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the jmeter-to-k6@0.1.17 postinstall 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!     /home/reda/.npm/_logs/2019-07-03T14_13_01_394Z-debug.log
droidnxs commented 5 years ago

I'm facing the same error as OP :(

rahulmr commented 5 years ago

Yes @bookmoons same as everyone is facing. Guys at least mention some bypass or fix it ASAP.

bookmoons commented 5 years ago

Something changed in jsonpath that breaks building it with browserify. We were affected by these issues: dchester/jsonpath#128 dchester/jsonpath#129

19 will push a fix for this.

Until then you can get it to work by nailing jsonpath to v1.0.1:

git clone https://github.com/loadimpact/jmeter-to-k6.git
cd jmeter-to-k6

In package.json change your jsonpath line from this:

        "jsonpath": "^1.0.0",

To this:

        "jsonpath": "1.0.1",

Then you can install from source:

npm install --global .
jmeter-to-k6 example/IfController.jmx -o build

There's a 2nd, different error reported in this thread that I think is unrelated. If you still see it after the fix please open another issue for it.