Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

SDK li export-studio-plugin fails (first time used)

Managed to install the SDK but cannot retrieve the plugin at studio:

li export-studio-plugin

I get the following errors:


MPLithiumSDK IanATJMP$ li export-studio-plugin
    throw err;

Error: Cannot find module 'has-color'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/lithium-sdk/node_modules/gulp-util/node_modules/chalk/index.js:4:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Not sure where to look for an answer to that one. How do I resolve this? There's nothing in troubleshooting section.


In fact, even just using the li command to get help gives me the same errors. 



4 Replies 4

Hi @Inactive User,


I faced the same error message some days ago when I tried different Lithium-SDK commands.

I solved the issue by changing the permissions of some folders in my OS (MacOS El Captain). See the troubleshooting section here. After changing the permissions I re-run the npm install commands for gulp and the lithium-sdk and everything works as expected.


Maybe this will also helps you to get your SDK working.


Best regards,


Not applicable

Looks like there were a few issues:


  1. I had accidentally installed node.js 6.x.x, and as of the time of this post, the SDK only works with node.js 4.x.x.
  2. After removing 6.x.x and installing 4.x.x, I had other issues. I had to change permissions within the /bin/ folder where things were failing, because I couldn't actually change permissions for the /bin/ folder itself.  See: Troubleshooting permission errors in Non-Windows environments, at the bottom of Get Started (
  • cd /usr/local/lib/
  • sudo chown -R $USER node_modules
    • Give yourself write access to /bin:
  • sudo chmod -R a+w /usr/bin 

Couldn't give myself access to that last one, so I chmod subfolders of this as needed to get around the access errors.

Not applicable

Thanks @cike.

Hello everyone, I am facing the same issue while trying to execute "li export-studio-plugin" command.
Mine is set up on Windows. Here are the versions that I am currently using:
Node 4.9.1, npm 2.15.11, gulp CLI version: 2.3.0, Local version: 4.0.2.
I am running CLI as an admin. 

This is the error message that I am getting

C:\Users\smontero\OneDrive - NI\Desktop\NI Community - SDK\ni-community>li export-studio-plugin

throw new assert.AssertionError({
AssertionError: Task function must be specified
at Gulp.set [as _setTask] (C:\Users\smontero\OneDrive - NI\Desktop\NI Community - SDK\node_modules\gulp\node_modules\undertaker\lib\set-task.js:10:3)
at Gulp.task (C:\Users\smontero\OneDrive - NI\Desktop\NI Community - SDK\node_modules\gulp\node_modules\undertaker\lib\task.js:13:8)
at module.exports.gutil (C:\Users\smontero\AppData\Roaming\nvm\v4.9.1\node_modules\lithium-sdk\gulp\clean.js:51:8)
at module.exports (C:\Users\smontero\AppData\Roaming\nvm\v4.9.1\node_modules\lithium-sdk\gulp\includes.js:23:24)
at Object.<anonymous> (C:\Users\smontero\OneDrive - NI\Desktop\NI Community - SDK\ni-community\gulpfile.js:3:37)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

  I am not so sure if the issue is related to the read-only one, because I have set everything as not read-only with windows properties UI wizard.
I am running out of ideas on what should I do to make it work. 

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.