Forum Discussion

jaread83's avatar
jaread83
Champion
8 years ago

SDK li create-project command produces an error

Hi all,

I recently learned about the SDK and am quite interested in getting it set up as purely working in Studio has broken me.

I followed all the steps required to get node and the Lithium SDK installed and then moved on to creating my project directory using li create-project.

After inputting the foldername, staging url (including the https) and SDK token, it goes through the motions and then shows this error (personal info removed):

npm WARN lithiumsdk3@ license should be a valid SPDX license expression
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/Users/xxxx/.npm-packages/bin/npm" "install"
npm ERR! node v4.4.2
npm ERR! npm  v4.0.5
npm ERR! path /Volumes/Git/lithiumsdk3/node_modules/lithium-sdk/node_modules/abbrev
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/Volumes/Git/lithiumsdk3/node_modules/lithium-sdk/node_modules/abbrev' -> '/Volumes/Git/lithiumsdk3/node_modules/abbrev'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Volumes/Git/lithiumsdk3/npm-debug.log
[16:53:31] Error while creating lithiumsdk3

I have tried using node 6.x.x and tried downgrading it to 4.x.x to see if it would work but I always get the same result with this error.

Has anyone else encountered this? Would really like to get this set up.

I can provide the full debug if that is what you would need?

Many thanks,

Jack

7 Replies

  • Hi Jack, 

     

    Provided you have Node v4.x installed, git is available in the command line and you've followed the steps in the documentation you should be good.

     

    From the error you're getting it would appear it's permissions related, I've found you sometimes need to run the command with sudo to get it to go through.

     

    Try:

    sudo li create-project

    Let me know how you get on,

     

  • jaread83's avatar
    jaread83
    Champion
    8 years ago

    Hi RobertT, I already tried using the sudo command in case it was due to permissions but the same error appears unfortunately. My node is currently set to 6.10.0 - does it need to be 4.x for this to work?

  • RobertT's avatar
    RobertT
    Boss
    8 years ago

    jaread83 I'd recommend NodeJS 4.x which is what I use, I've seen some odd quirks with 6.x so I'm not sure that's fully supported yet.

  • jaread83's avatar
    jaread83
    Champion
    8 years ago

    Generally I will keep all my code bases in a seperate partition of the HDD - I got around 20 repos that I work on so it makes sense to do this.

    As an experiment, I just tried creating the lithium project in my home directory. That seemed to work! So that means the lithium SDK repo needs fixing up as it doesn't seem to like it when I create a project on a seperate drive.

  • jaread83's avatar
    jaread83
    Champion
    8 years ago

    Hi RobertT, thanks for your help so far. I managed to create the project in my home directory and am now playing about with it.

    Trying to get my SASS compiler to work but my browser is blocking the localhost CSS being displayed. Something about mixed content so I suspect this is an issue with the localhost being served under http and the staging site being served under https. When trying to serve my localhost CSS with https it fails to load the file entirely.

    How did you get around this?

  • RobertT's avatar
    RobertT
    Boss
    8 years ago

    jaread83

     

    This one is a pain, it either requires you to build a HTTPS service on your machine which points to the directory that the SASS is compiled from or you need to adjust browser settings to add an exception to allow mixed content.

     

    We're not using HTTPS on our staging environment at the moment but I have played around with running a HTTPS server from my machine for testing, this is one of the areas that Lithium will need to address as more and more communities switch over to HTTPS default traffic.

     

    For Chrome the following should work in terminal to allow mixed-content mode:

    open /Applications/Google\ Chrome.app --args --allow-running-insecure-content

     

  • jaread83's avatar
    jaread83
    Champion
    8 years ago

    Ah that did it! Nice :) thanks for your help with this. I am always learning something new with this platform.

    I also agree with the http/https configuration stuff. It would make sense for the SDK to serve up a https version (or at the very least base the protocol on the staging url provided). I may have more questions after having a play around :)