Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot initialise Astrum or create components. #117

Closed
jackw opened this issue Apr 22, 2017 · 2 comments
Closed

Cannot initialise Astrum or create components. #117

jackw opened this issue Apr 22, 2017 · 2 comments

Comments

@jackw
Copy link

jackw commented Apr 22, 2017

Tell us about the issue you are experiencing
Having installed Astrum globally I cannot init any directory or create new components. If I attempt either I end up with errors stating Pattern Library has already been initialized or no config file found in project root. I've tried copying the empty json file into the public/pattern-library directory and I still cannot proceed. A similar issue has been closed here.

jackw@jackws-mac ~/Documents/astrum-test $ ls -la
total 16
drwxr-xr-x   3 jackw  staff   102 22 Apr 18:25 .
drwx------+ 18 jackw  staff   612 22 Apr 18:07 ..
-rw-r--r--@  1 jackw  staff  6148 22 Apr 18:12 .DS_Store
jackw@jackws-mac ~/Documents/astrum-test $ mkdir -p public/pattern-library
jackw@jackws-mac ~/Documents/astrum-test $ astrum init public/pattern-library/
/Users/jackw/.nvm/versions/node/v7.2.1/lib/node_modules/astrum/manager/utils.js:41
                throw(new Error(chalk.red('Pattern library has already been initialized.')));
                ^

Error: Pattern library has already been initialized.
    at /Users/jackw/.nvm/versions/node/v7.2.1/lib/node_modules/astrum/manager/utils.js:41:23
    at FSReqWrap.cb [as oncomplete] (fs.js:239:19)
jackw@jackws-mac ~/Documents/astrum-test $ astrum new navigation/primary
/Users/jackw/.nvm/versions/node/v7.2.1/lib/node_modules/astrum/manager/utils.js:24
            throw(new Error(chalk.red("No astrum-config.json file found in project root.")));
            ^

Error: No astrum-config.json file found in project root.
    at Object.init (/Users/jackw/.nvm/versions/node/v7.2.1/lib/node_modules/astrum/manager/utils.js:24:19)
    at Object.<anonymous> (/Users/jackw/.nvm/versions/node/v7.2.1/lib/node_modules/astrum/manager/astrum-new.js:9:7)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
jackw@jackws-mac ~/Documents/astrum-test $ which astrum
/Users/jackw/.nvm/versions/node/v7.2.1/bin/astrum
jackw@jackws-mac ~/Documents/astrum-test $ astrum -V
1.9.3
jackw@jackws-mac ~/Documents/astrum-test $ npm -v
3.10.10
jackw@jackws-mac ~/Documents/astrum-test $ node -v
v7.2.1

I've tried copying the example json file in the readme and I receive the same errors.

What behaviour would you expect?

As described in the readme file - to be able to initialise a project and create new components.

How can this issue be replicated?

Clean install on Mac OS Sierra.

Your environment

Platform: Mac
OS Version: MacOs Sierra 10.12.3
Node Version: 7.2.1
NPM Version: 3.10.10
Astrum Version: 1.9.3

I'm running NVM which apparently fixed the issue for @philbert440.

Any ideas?

@jackw
Copy link
Author

jackw commented Apr 24, 2017

I've figured out the error of my ways. The issue occurs when trying to initialise a directory that already exists. Doing so results in an empty config file in root and an error message that doesn't really make sense in these conditions.

@RyanHavoc
Copy link
Member

@jackw I'll look to add in additional checks and feedback to help avoid this in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants