command not found: wrangler after installation of wrangler - cloudflare

I am trying to install the Cloudflare wrangler in ubuntu and I am able to install using normal command but when I use wrangler --version I am getting an error wrangler command not found and I have installed wrangler on the root using this command
basically i am trying to install
I have also used normal command npm i #cloudflare/wrangler
sudo npm install #cloudflare/wrangler -g --unsafe-perm=true --allow-root
wrangler --help (getting the above-mentioned error)
wrangler generate my-worker (getting the above-mentioned error)
but when i am using npx wrangler generate my-worker i am able to create the project but when i am running
wrangler preview(same error so don't know how to solve this issue)
I am using Node version v10.10.0
and npm version is v6.13.6

Your installation of wrangler was local to the project you're in, in order for the wrangler command to work, it needs to be installed globally. npx runs the local project installation of wrangler, that is why that command works.

Related

azure devops npm task

I am currently using npm task in my build pipeline in azure devops.
Recently the npm run step started failing with below error. When I manually install the sass and sass-loader the npm run step passes without any error. How can I install the complete modules from pipeline.?
ERROR in Module build failed (from ./node_modules/#angular-devkit/build-angular/node_modules/sass-loader/lib/loader.js):
You can try the following ways to see if the problem can be solved:
Execute the npm install command to install the node-sass (see here) in the pipeline.
npm install -D node-sass
Reconfigure your npm package on the local machine.
Install or upgrade Angular to the latest version.
Check out the source repository to the local machine.
Remove the nose modules and the package lock.
Reinstall the refresh dependencies for your package via the npm isntall command.
Push the changes to the remote repository, then try the pipeline.
I have fixed the issue by adding another step with npm task and passed and argument(sass-loader) to install the sass modules.

How to Update Angular Cli

Just to give you some context.
I was running a project and after ng serve I was getting this warning message:
our global Angular CLI version (9.1.4) is greater than your local
version (1.0.0). The local Angular CLI version is used.
I googled and figured out I should update angular cli with the following command.
npm install --save -dev #angular/cli#latest
After that I am getting the following error when trying to build the project:
The build command requires to be run in an Angular project, but a project definition could not be found
Any help will be much appreciated.
After reading some issues reported on the GitHub repository, I found the solution.
In order to update the angular-cli package installed globally in your system, you need to run:
npm uninstall -g angular-cli
npm install -g #angular/cli#latest
Depending on your system, you may need to prefix the above commands with sudo.
Also, most likely you want to also update your local project version, because inside your project directory it will be selected with higher priority than the global one:
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev #angular/cli#latest
npm install
After updating your CLI, you probably want to update your angular version too
Note: if you are updating to Angular CLI 6+ from an older version, you might need to read this
Edit: In addition, if you were still on a 1.x version of the cli, you need to convert your angular-cli.json to angular.json, which you can do with the following command:
ng update #angular/cli --from=1.7.4 --migrate-only
check here for more details.

Angular 5 not able to create simple project

I am new to angular, and starting with angular 5.
I have just installed node-v8.11.3-x64,
and run below commands :
npm install -g #angular/cli
ng -v & npm -v
and finally run below command :
ng new "hello-hello"
but getting below error
please help me to get rid of it.
For #fabi_K
For #fabi_k after cleaning cache
You probably have an issue by installing your dependencies. Just skip that part and run npm install -d und your generated project.
When you are behind a corporate proxy, ensure that your npm proxy settings are set correctly.

Babel Errors in Cloud 9 IDE

Getting a bunch of babel errors when running npm run dev with the Vue cli.
This only happens in Cloud9.
Any thoughts on what could be the issue or how to disable errors like this before running npm run dev?
All babel related it looks like.
I couldn't re-create the babel error messages but it's possible that it could be caused if npm/node is not up-to-date. (Vue-cli wasn't starting dev server before the installation below)
Is your repository public where you're getting the error messages? Then I could have a look at the errors.
If removing node_modules folder is not helping,
here is how you can create a new IDE workspace for vue.js ($ for commands in bash terminal):
Create a blank Ubuntu workspace
Check that nvm is installed & up-to-date with (check version of install script here):
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
$ nvm install node 6
$ npm i vue-cli -g
$ vue init webpack yourAppName
$ cd yourAppName
$ npm install
$ npm run dev
Click preview to test that Vue server is running as expected
Here is a link to a HelloWorld Vue app in cloud9 ide.
If you have an existing app you can also use git to clone it into your new workspace instead of creating a new app.

migrate command not found error even if migrate is installed

I have executed command -
npm install migrate
and it has executed successfully. But when I try to execute the command migrate in terminal it gives me error as migrate command not found
Please find image here.
Has anyone got the same error?
try installing it globally
npm install migrate -g
I have two solutions to this problem.
The first is to attempt to install the package globally.
npm install -g migrate
If above  solution not worked, it could be due to the current user's undefined ExecutionPolicy.
As an administrator, run the following PowerShell command:
Set-ExecutionPolicy RemoteSigned