Search code examples
javascriptnode.jsaureliasystemjsjspm

JSPM - jspm install gives error "Registry not found"


Recently i started playing with aurelia-framework and so far so good but when i edited config.js to add some of my files that are not installed via jspm things worked fine i was importing my scripts no errors but when i cloned to another machine and run jspm install it fails cause it does't like that i have other paths other than npm and github in my config.js

Configjs

paths: {
    "*": "dist/*",
    "github:*": "jspm_packages/github/*",
    "npm:*": "jspm_packages/npm/*",
    "lib:*": "lib/*",
    "styles:*": "styles/*"
},

map: {
    "app-styles": "styles:app-styles",
    "uisearch": "lib:uisearch/[email protected]",
    "component": "lib:component/component",
    "classie": "lib:classie/[email protected]",
    "material": "lib:material/material",
    "ripples": "lib:ripples/ripples",
    "bootstrap-select": "lib:bootstrap-select/[email protected]"
    other deps...
}

Error Message

err Registry lib not found.

err Unable to load registry lib

warn Installation changes not saved.

Please help am new to this :)


Solution

  • Avoid making changes to the map section of your config.js by hand. Instead use the jspm command line interface to add packages. The jspm CLI will maintain your config.js for you. For example, to add classie to your project you would execute the following:

    jspm install npm:desandro-classie
    

    More information at jspm.io.

    Note: you don't need to edit the config.js to enable importing javascript/css that is part of your project.

    If I'm interpreting your original post correctly you have a lib folder containing a ripples subfolder which has a ripples.js file inside of it. You could access this "ripples" module like this:

    import ripples from 'lib/ripples/ripples';
    
    ripples.foo();
    ...