Custom Widget Mendix 8 - Mendix Forum

Custom Widget Mendix 8

1

Hi,

Am going through this tutorial(https://docs.mendix.com/howto/extensibility/create-a-pluggable-widget-one) and am stuck at 3.3.3 where I need to run npm run dev.

I have updated npm and installed all required prerequisites, but keep on getting this error:

> cd ./node_modules/@mendix/pluggable-widgets-tools && node bin/mx-scripts.js "start:ts"

/usr/bin/bash: line 0: cd: ./node_modules/@mendix/pluggable-widgets-tools: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! textBox@1.0.0 mx-script: `cd ./node_modules/@mendix/pluggable-widgets-tools && node bin/mx-scripts.js "start:ts"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the textBox@1.0.0 mx-script 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\AppData\Roaming\npm-cache\_logs\2019-08-07T14_21_33_483Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! textBox@1.0.0 dev: `npm run mx-script start:ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the textBox@1.0.0 dev 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\AppData\Roaming\npm-cache\_logs\2019-08-07T14_21_33_534Z-debug.log

I assume after I build this without errors It adds it to my project’s widgets and dont need to do it like modeler version 7 where I used to copy the mpk to widget directory.

Thanks

asked
7 answers
1

Hi Samim, you should update your Generator, we just launched version 8 together with Mendix 8. Please take a look at this repo:
https://github.com/mendix/pluggable-widgets-generator

 

**Your dependencies are outdated

answered
0

Yea didnt install it globally.

Do you know if  Mendix 8 default widgets (e.g. drop down) is open source?

answered
0

`pluggable-widget-tools` should NOT be installed globally.

answered
0

Resolved now…

had content inside .npmrc in C:\Users\<user> removing that and running npm i solved it!

answered
0

Hi Diego

Yes tried it with Git Bash and Windows Powershell still same error. Updated Node too in case that was causing the issue but no joy.

PS. according to this: if I re-generate  @mendix/pluggable-widgets-tools’ version should be ^8.0.1 but I get ^8.0.0. But then again even if I do it manually still get same error (btw also uninstalled pluggable-widgets-tools globally and reinstalled it again)

answered
0

Hi Samim, apparently is your command line, I've also tested with Git Bash and it's working as expected. Just try to use another one like powershell or the default cmd.

 

Check my screenshot

https://imgshare.io/image/7MNoH

 

answered
0

Hi Diego,

Thanks for the reply I did run below commands(and recreated the project):

npm install -g yo@latest
npm install -g @mendix/generator-widget
npm install

now get this:

/usr/bin/bash: pluggable-widgets-tools: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file C:\Program Files\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! textbox@1.0.0 dev: `pluggable-widgets-tools start:ts`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the textbox@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

answered