Error install Angular 4 using npm - javascript

When i install angular and try to use this command line :
ng -v i got an error (check jpeg file) ..
I have installed : node 6.10.3
someone have a solution

Those errors are caused by you manually stopped #angular/cli from installing packages into your project folder.(When running ng -v in a angular/cli project folder, angular/cli will trying to output your version information of installed #angular/xxx packages).
mention that when you pressed Ctrl + C, the task will stop even you pressed N later.
Solution:
run npm install at your project folder and wait for it to be finished, then when you run ng -v again, the errors will gone.

Related

✖ Installing Bundler error Error: Looks like your iOS environment is not properly set

✖ Installing Bundler
error Your Ruby version is 2.6.8, but your Gemfile specified 2.7.4
✖ Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
But my Ruby version is 2.7.5
I tried run below commands:
yarn global remove react-native-cli "after install again"
rvm install ruby/latest
npm install -g #react-native/cli
But nothing works :(
I used RVM to install ruby and restarted the terminal. It worked.
Use this to install RVM:
\curl -sSL https://get.rvm.io | bash -s stable
Install the ruby version you would like (2.7.5 in this case):
rvm install 2.7.5
This is an open issue in the RN repo. Looks like react-native-cli just cannot figure out that the Ruby version is indeed correct. You can avoid the CLI command by going to the project directory and running:
bundle install
cd ios && bundle exec pod install
Link

Error: You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1)

As the title says, I cannot run create-react-app.
You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
Doing this does not change the error. npm uninstall -g create-react-app
I entered this command to try it out and got a message that the tar was out of date.
npm install -g create-react-app
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code EEXIST
npm ERR! path /opt/homebrew/bin/create-react-app
npm ERR! EEXIST: file already exists
npm ERR! File exists: /opt/homebrew/bin/create-react-app
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
https://www.npmjs.com/package/tar
I ran the command with this reference.
However, the tar was not updated.
I have already tried all the published solutions, but they don't work. Can someone please help me? Please.
I tried clearing the cache but could not solve the problem.
npx clear-npx-cache
Need to install the following packages:
clear-npx-cache
Ok to proceed? (y) y
I was able to successfully run the following command by specifying the version each time, but it is a hassle and I want to be able to run it normally.
npx create-react-app#latest my-app
The "fish" shell I am currently using is node v18.0.0, so I downgraded to v16.15.0 and it works fine.
fisher install jorgebucaran/nvm.fish
nvm install v16
I had forgotten to lower the node version in fish because it had been working fine with zsh.

Npm install/run dev fails for not finding Git Bash

I have a Javascript project set using React.js. Npm install for nodemon package version 2.0.7 fails with following errors:
It seems that the installation is trying to spawn Git Bash but without success.
Should the installation spawn bash.exe from the folder C:\Program Files\Git\bin instead
of C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Git\Git Bash?
Same error message happens when running npm run dev to start the Node server:
Same errors happen when run from Git Bash.
Earlier nodemon version 1.10.0 installation succeeds with no errors.
I have
OS Windows 10
npm version 6.14.8
node version 14.15.0
git version 2.28.0.windows.1
I think my Git is set to environment path variable correctly.
What could be causing this error?

Gatsby - Command failed with exit code 1: npm install

I'm trying to start my first Gatsby project but keep encountering the same error when creating a new project.
After running gatsby new project-1, I get the following error:
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tom.allen/.npm/_logs/2020-06-18T15_54_40_537Z-debug.log
ERROR
Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
- error.js:56 makeError
[lib]/[gatsby-cli]/[execa]/lib/error.js:56:11
- index.js:114 handlePromise
[lib]/[gatsby-cli]/[execa]/index.js:114:26
- task_queues.js:97 processTicksAndRejections
internal/process/task_queues.js:97:5
- init-starter.js:139 async install
[lib]/[gatsby-cli]/lib/init-starter.js:139:7
- init-starter.js:206 async clone
[lib]/[gatsby-cli]/lib/init-starter.js:206:3
- init-starter.js:345 async initStarter
[lib]/[gatsby-cli]/lib/init-starter.js:345:19
- create-cli.js:400
[lib]/[gatsby-cli]/lib/create-cli.js:400:7
I have tried deleting the node_modules inside the project folder and running npm i again but I can't work out how to fix this issue. I'm on node v12.17.0 if that makes a difference... Any help will be really appreciated!
Install nvm
We strongly recommend using a Node version manager like nvm to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.
npm's docs
If you have installed Node via some package manager or some Node installer, first of all, uninstall it and instead install Node from nvm. In my case I had installed Node via NodeSource, so:
sudo apt purge node
Go ahead and install nvm, following the instructions on the Github repo. I had to include the shell script manually in my ~/.zshrc because the nvm script didn't do.
Install node and npm via nvm
Run the following to install Node and npm: nvm install node
Now, in order to make gatsby new works, you will need to install a previous version of node, which will be: v14.13.1. Run the following command and you will install the mentioned version:
nvm install 14.13.1
Select the Node version to use if is not selected:
nvm exec 14.13.1 node --version
Gatsby
Now, you only need to install Gatsby CLI, and then simply use it.
Run the following: npm install -g gatsby-cli
Go to the folder where you want to create your project and then run:
gatsby new [your-project-name] https://github.com/thomaswangio/gatsby-personal-starter-blog
So there's a few suggestions:
Hard cache removal: npm cache clean --force
Upgrade gatsby-cli version: npm update
Delete node_modules and .cache folder
Keep in mind removing package-lock.jsonto unlock you dependencies.

npm wont start a react app, requires a dependency: "webpack-dev-server": "3.1.14"

I am trying to create a new react-app and start it, I have created react apps before with no errors but this time when i npm start i get this error
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix
locally.
The react-scripts package provided by Create React App requires a
dependency:
"webpack-dev-server": "3.1.14"
Don't try to install it manually: your package manager does it
automatically.
However, a different version of webpack-dev-server was detected higher up
in the tree:
C:\Users\ashraf\node_modules\webpack-dev-server (version: 3.1.9)
Manually installing incompatible versions is known to cause hard-to-debug
issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to
an .env file in your project.
That will permanently disable this message but you might encounter other
issues.
To fix the dependency tree, try following the steps below in the exact
order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your
project folder.
2. Delete node_modules in your project folder.
3. Remove "webpack-dev-server" from dependencies and/or devDependencies in
the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the
above steps with it instead.
This may help because npm has known issues with package hoisting which may
get resolved in future versions.
6. Check if C:\Users\ashraf\node_modules\webpack-dev-server is outside
your project directory.
For example, you might have accidentally installed something in your home
folder.
7. Try running npm ls webpack-dev-server in your project folder.
This will tell you which other package (apart from the expected react-
scripts) installed webpack-dev-server.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in
your project.
That would permanently disable this preflight check in case you want to
proceed anyway.
P.S. We know this message is long but please read the steps above :-) We
hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! learnreact#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the learnreact#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ashraf\AppData\Roaming\npm-cache\_logs\2019-02-
04T20_36_39_924Z-debug.log
PS C:\Users\ashraf\Desktop\Files\LearnReact\learnreact>
i have tried all the steps in detail in the error log but its still not working, any thoughts on what is causing this error? Thanks in advance
It seems like you want to depend on webpack-dev-server inside your local project.
Perhaps you need to run npm install in your project, instead of your ~ home directory?
from your output, notice these lines.
However, a different version of webpack-dev-server was detected higher up
in the tree:
C:\Users\ashraf\node_modules\webpack-dev-server (version: 3.1.9)
...
6. Check if C:\Users\ashraf\node_modules\webpack-dev-server is outside
your project directory.
For example, you might have accidentally installed something in your home
folder.
so I would
cd ./my-project
npm i
Did you install webpack-dev-server on its own? It seems it has been installed either by you or by another project install. Webpack is for your local development environment so the other install is close enough to your project to interfere with the copy that react is trying to install in your project folder. Steps 1-4 in your error message should resolve your issue. If you have done that and its still not working, did you get different error messages with your next attempt to install your react package?
I have faced the same issue and this method worked for me.
Do follow the steps:
Start terminal from the desktop and write this command:
npm uninstall webpack-dev-server
This will uninstall webpack-dev-server package globally from you node modules.
Go back to you the terminal of your project and install webpack-dev-server package:
npm install webpack-dev-server#version
Note: The version part (above) should equal the versions asked for in the error message.
npm install webpack-dev-server
Now start npm:
npm start
This error mostly occurs when you have created your project using the
npx create-react-app command instead of the npm create-react-app command.

Categories

Resources