Simple ASK CLI install in windows not working - npm

I installed in Windows 10 ASK CLI with
npm install -g ask-cli
without errors.
But the next step
ask new
results in the error:
Invalid json: C:\Users\user1\.ask\cli_config
Sure, the folder
C:\Users\user1\.ask
doesn't exist.
Is there something fundamentally wrong?

Yes. You haven't initialized the CLI with ask init which is the step that will ultimately generate the cli config file. Please read the installation docs again!

ASK CLI v2 replaces the ask init command with the ask configure command to configure the ASK CLI with your Amazon developer account credentials. See docs

Related

AsyncApi Change npm registry url

Is there are command-line switch to point the npm registry to different url? I have created a template and published to our company's registry. When referring the package, it is referring to https://registry.npmjs.org/. I did install the template locally using
C:\>npm install -g #company/asyncapi-csharp-template
C:\>ag DomainServiceA.yml #company/asyncapi-csharp-template -o ouput
and the error response is
Something went wrong:
HttpErrorGeneral: 404 Not Found - GET
https://registry.npmjs.org/#company%2fasyncapi-csharp-template - Not found
Tbh best if you submit issue here https://github.com/asyncapi/generator/issues as normally it should work.
also try to add --debug flag to understand more what is happening with template usage in generator

How do I correctly scaffold a new Docusaurus website?

Trying to get started with a Docusaurus v2 website. Don't know much about npm or JavaScript in general, so maybe I'm missing something obvious.
I'm on Ubuntu 20.10, npm -v is 6.14.8, npx -vis 10.2.2 and yarn -v is 1.22.5.
When I execute the example from the documentation, I get an error:
$ npx #docusaurus/init init my-website classic
Too many arguments.
If I try without the name or template, I would expect it to prompt for them, but get another error:
$ npx #docusaurus/init init
Expected single character argument.
Is there something fundamentally wrong with my npm installation?
Thanks
Turns out, I just had to user a newer node version. Details about the issue are here.
A workaround would be to use #latest as in
npx #docusaurus/init#latest init my-website classic

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded

while installing cypress through command :npm install cypress --save-dev getting error as The Cypress App could not be downloaded.
Error :
Finishing Installation
The Cypress App could not be downloaded.
Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
Otherwise, please check network connectivity and try again:
But please not I m not using any proxy and on my personal wifi.
plz suggest ,what can be done in this case.Thanks
It seems to be too many possible reasons for this issue in general but I managed to find a workaround to install Cypress from within a corporation with npm and without using sudo npm or turning off strict ssl.
The following worked for me per November 18th 2020 with Ubuntu 18.04 and npm 6.14.8:
I downloaded the zip file shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Direct-download
I installed cypress as shown in https://docs.cypress.io/guides/getting-started/installing-cypress.html#Install-binary : CYPRESS_INSTALL_BINARY=~/Downloads/cypress.zip npm install cypress --save-dev
I could now run npx cypress open to start the gui (which will also generate the cypress.json file)
Possible Reasons for this issue:
U might be running the project with a proxy setting.
One of the reason could be you are behind the firewall.that may prohibit your network? Please follow the guidelines in Proxy Configuration if so(https://docs.cypress.io/guides/references/proxy-configuration.html#Set-a-proxy-on-Linux-or-macOS).
make sure you have right access to install the cypress.
if none of the above mentioned reasons try removing the biraries or node_modules and install again.

AppCenter Yarn 1.19 error Incorrect integrity when fetching from the cache

I have a React Native app hosted on Microsoft App center. The builds (both iOS and android) are failing because of yarn 1.19 (error Incorrect integrity when fetching from the cache)
I tried to remove the package-lock.json but it didn't help.
I would like to downgrade yarn or execute the cache clean command but don't know where to execute it.
I have installed the appcenter cli version 2.2.1 and successfully connected to it.
Where could I execute yarn cache clean for example?
I've read I could also create a script but I have no idea where to place it and how it should look like. Should it be both in the ios and android directory? Or in the root? Thank you
I actually noticed that I had a yarn.lock back from the initial commit, even though we are using npm in the team.
In the build logs, there is this line:
/bin/sh -c if [ -f yarn.lock ]; then { yarn install && yarn list --depth=0; } else npm install; fi
So I deleted the yarn.lock file and now it builds successfully using npm!
Not sure whether you build your React app with Azure Devops pipeline. If yes, you can use Command line task to achieve the things you want to do.
If the agent you used is hosted agent during the build, since each build will use a completely new VM, you need to install the AppCenter cli once per build.
Use follow command to install the AppCenter cli:
sudo npm install -g appcenter-cli
Then logging in it:
appcenter login --token {Token}
Here, you need first generate the token with this doc described: Go and login to https://appcenter.ms/ -> Click Self Avatar -> Choose Account Settings -> Click on API Tokens -> Click New API token then select the corresponding the scope for this token.
Copy and use it in this pipeline task. Note: Recommend you store
this token with secret variable for security.
Now, you can execute the clean command: yarn cache clean.
Where to place it and how it should look like?
According to your description, you need place this command line task into the first step, then it could clean the Yarn cache firstly.
Also, because of the image configuration that the hosted agent is using, its installed node.js version is 6.7.0, this does not match the runtime environment for AppCenter cli. You need also run Node.js tool installer task to install node.js v10.0.0.
All of them should look like this:
Should it be both in the ios and android directory?
As I mentioned previously, for Hosted agent, each build will use a completely new VM. So yes, you must execute these two steps firstly in every build.
If what you used is your private agent, since you have installed the AppCenter cli locally, the agent will automatically call the local configuration when running the command line task. At this time, you just need to skip the install command in the command task:
We fixed it by adding a "yarn cache clean" in appcenter-post-clone.sh, you can add this shell script in root of project.
See this docs for details.

npm not recognised after installing Heroku Toolbelt

I've installed Heroku Toolbelt (https://toolbelt.heroku.com/) on a Windows 7 system.
I've followed the tutorial up to here: https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-app-dependencies
When I run the command npm install it gives the following error:
'npm' is not recognized as an internal or external command, operable program or batch file.
I understand this means it can't find/execute npm. But this is going from Heroku's own tutorial/documentation, in sequence, and doesn't say you need to install anything else to get this working. When I go to the npm website (https://www.npmjs.com/) it also says:
The npm command-line tool is bundled with Node.js. If you have it installed, then you already have npm too.
Something is wrong with this!
Try to reinstall nodejs. Alternatively, you can install nvm for windows, which is a version manager for nodejs. It's pretty useful and easy to install. Check it out at https://github.com/coreybutler/nvm-windows