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

Wrong module path? #64

Closed
NonPolynomial opened this issue Sep 2, 2016 · 10 comments
Closed

Wrong module path? #64

NonPolynomial opened this issue Sep 2, 2016 · 10 comments
Assignees
Labels

Comments

@NonPolynomial
Copy link
Contributor

NonPolynomial commented Sep 2, 2016

Tell us about the issue you are experiencing

If i try to astrum init ./patterns/ (or any other path) i get the following error:

Error: Error: ENOENT: no such file or directory, lstat 'C:\Users\NonPolynomial\AppData\Roaming\npm\node_modules\astrum\_template'

It seems that astrum tries to get the template files from my appdata folder, but node and npm are installed in C:\Node

What behaviour would you expect?

Astrum should look for the template files in the folder node / npm / astrum was installed in.

How can this issue be replicated?

astrum init ./patterns/

Your environment

Platform: PC
OS Version: Windows 8.1
Node Version: 6.3.0
NPM Version: 3.10.5
Astrum Version: 1.6.3


Editted: fixed typo

@NonPolynomial
Copy link
Contributor Author

NonPolynomial commented Sep 2, 2016

i could solve this with following changes on manager/utils.js:

var fs = require('fs-extra'),
    chalk = require('chalk'),
    inquirer = require('inquirer'),
    dir = require('global-modules'),
    mkdirp = require('mkdirp'),
    isWindows = require('is-windows'),
    pjson = require('../package.json'),
    path = require('path');

module.exports = {

    // resolve module path with path module
    module_path: path.resolve(`${__dirname}/..`),

    /* ... */
}

@NonPolynomial NonPolynomial changed the title Wrong template path? Wrong module path? Sep 2, 2016
@RyanHavoc
Copy link
Member

@NonPolynomial I'm assuming then that you install your global node modules into a non-default location on Windows? I was expecting the global-modules dependency to resolve the correct path in that case...

Thanks for the feedback on what change could be made. I'll test it out, I just need to ensure it sets the correct path in all instances. Mac and Windows alike.

@RyanHavoc RyanHavoc self-assigned this Sep 3, 2016
@RyanHavoc RyanHavoc added the bug label Sep 3, 2016
@NonPolynomial
Copy link
Contributor Author

hey @RyanHavoc ,

i expected global-modules to do this, too. :c
Shouldn't process.argv always do the trick here?
I thought, it wouldn't be bound to any OS.

Further explanation:
i didn't "install" node. i just downloaded the node.exe and the npm tarball and unpacked it, and set the environment variable to node myself, because thats what the installer just do.

@RyanHavoc
Copy link
Member

@NonPolynomial It should do the trick but then again I wouldn't have expected it to break in your case in the first place. Testing required!

@NonPolynomial
Copy link
Contributor Author

Do you plan to include a bugfix for that in any version? @RyanHavoc

@RyanHavoc
Copy link
Member

@NonPolynomial Could you try out the release/2.0.0 branch and see if your problem has been resolved in that release?

@NonPolynomial
Copy link
Contributor Author

NonPolynomial commented Jan 31, 2017

I'm afraid, it's not :/

I've installed 2.0.0-rc.5.

_this.module_path targets the wrong path in appdata in manager/utils.js.

I could fork your project, apply my changes and make a pull request, when I'm at home.

@NonPolynomial
Copy link
Contributor Author

@RyanHavoc would you prefer, when I take a fork and apply the changes to master or to the release/2.0.0 branch?

@RyanHavoc
Copy link
Member

@NonPolynomial 'master' please. It's going to be a little while before v2.0.0 is ready for release.

@NonPolynomial
Copy link
Contributor Author

@RyanHavoc fixed with the merge #96 -> Release v1.9.5

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

No branches or pull requests

2 participants