sasjs / cli

Command line interface for creating, compiling, and building SAS® projects
https://cli.sasjs.io
MIT License
37 stars 5 forks source link

Error when using angular template #1211

Closed rudvfaden closed 2 years ago

rudvfaden commented 2 years ago

I get an error when running sasjs create my-sas-project --template angular

Creating SASjs project in /home/JB4555/my-sas-project./home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:196
        .stdout.match(/(?<!git version)\d+\.\d+\.\d+/) || '')[0].replace(/\./g, '');
                                                                 ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at createApp (/home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:196:66)
    at /home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:145:25
    at step (/home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:44:23)
    at Object.next (/home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:25:53)
    at /home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:19:71
    at new Promise (<anonymous>)
    at __awaiter (/home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:15:12)
    at /home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:143:78
    at new Promise (<anonymous>)
    at /home/JB4555/.nvm/versions/node/v16.15.1/lib/node_modules/@sasjs/cli/build/utils/utils.js:143:35
allanbowe commented 2 years ago

Thanks @rudvfaden - looking into it.

In the meantime, you can take the following steps (which is all the CLI does anyway):

git clone git@github.com:sasjs/angular-seed-app.git
cd angular-seed-app
 git submodule update --init --recursive
rm -rf .git
git init .
npm install
npm run build
allanbowe commented 2 years ago

@rudvfaden - our suspicion (given the error message above) is that you do not have GIT installed. Can you confirm if this is the case?

We are now looking to refactor this command to remove the GIT dependency.

rudvfaden commented 2 years ago

You are correct. Tried on a server with git installed. It worked.

allanbowe commented 2 years ago

GIT dependency removed