gyp ERR! configure error in ubuntu while installing angular 4 project - angularjs

I am a new bee in angular4. I am setting up an angular4 project (it's a simple admin panel) using npm install, but it's showing
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied,
It is happening to any angular4 projects, but simple angular4 program is working properly.

Go to project directory. and if you use mac than run below command, or for windows run the following without sudo,
sudo npm uninstall
sudo npm clean cache
sudo npm install
sudo npm install #angular/cli

Related

How can i solve NPM err when i get the npm ERR! code E404

I have just created a new laravel application to implement a chat app.
I wanted to scallfold the application using bootstrap but am getting this error :
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/33998 - Not found
npm ERR! 404
npm ERR! 404 '33998#*' is not in this registry.
npm ERR! 404
How can i solve it?
I tried running composer update to see if im missing some dependencies.
I was wrong.
I also runnpm install && npm run devit still did not work
Try to run these commands:
npm config set registry http://registry.npmjs.org
npm -g install npm
npm cache clean -f
After that try to run your project with:
npm run dev
This error is just because of the package 33998 could not be found in the npm registry.
For solution you need to install bootstrap package in your application manually.
For installing BootStrap Use
npm install bootstrap
Also clean the cache of npm forcefully by
npm cache clean --force
Also check the latest npm version and update it if it was to old.
npm -v
npm install -g npm

Error with terminal when trying to create-react-app

I'm trying to create a new react app, but I can't seem to do it. I have searched everywhere and done everything I could that can be done nothing is working. I have deleted node, npm, and npx two times and downloaded again, and then restarting my computer like 100 times but nothing works:
Need to install the following packages:
create-react-app
Ok to proceed? (y)
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
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/
my#mycomp-MacBook-Pro ~ % npm uninstall -g create-react-app
up to date, audited 1 package in 176ms
found 0 vulnerabilities
my#mycomp-MacBook-Pro ~ % npx create-react-app my-app
Need to install the following packages:
create-react-app
Ok to proceed? (y)
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).
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/
my#mycomp-MacBook-Pro ~ %
And after that if I try to npm uninstall -g create-react-app or anything else it alwayse send this error:
my#mycomp-MacBook-Pro ~ % npm uninstall npm uninstall -g create-react-app
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! [Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/local/lib/node_modules/npm',
npm ERR! dest: '/usr/local/lib/node_modules/.npm-i9nnxROI'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mycomp/.npm/_logs/2021-12-15T12_37_53_679Z-debug.log
my#mycomp-MacBook-Pro ~ %
How can I fix this?
The problem seems to be that of an inappropriate installation. The go-to way to fix this would be to ensure a proper uninstall of node and npm. Please follow the steps mentioned here. Once properly uninstalled, head over to install node and proceed with the re-installation.
First, remove the package. If you have installed create-react package using npm then use
- npm uninstall -g create-react-app
or if yarn
- yarn global remove create-react-app
Then you can create a project:
npx create-react-app my-app

i am new to angularjs 2 framework.i need help to understand this

How can i integrate angularjs 2 framework to my django project where i have used bootstrap.please help if you are good in angularjs 2 and bootstrap.thank you.
how to use this because on my side its not working
npm install -g angular-cli and npm install -g #angular/cli
ng new project-title
cd project-title
ng serve
this the error i am getting when i use these commandsnpm install -g angular-cliand npm install -g #angular/cli
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\harrugg>npm install -g #angular/cli
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#angular/cli"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! Cannot read property 'path' of null
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#angular/cli"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! code ECONNRESET
npm ERR! network socket hang up
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\harrugg\AppData\Roaming\npm-cache\_logs\2017-04-11T10_40_5
6_491Z-debug.log
strong text
As you know angular 2 is a component based frontend framework to build a single page web application. To integrate angular2/4 with Django. Create a restful API with Django and Django restframework and consume those API endpoints with angular2. That is the best and recommended way to work with Django and angular2.
For instance, if you have multiple Django application you can create on of your app to angular based on other normal Django app.
You can create a folder structure like this as shown below.
Here is the link that can help you to get started with Django and angular 2.
https://4sw.in/blog/2016/django-angular2-tutorial/
Regarding your installation error, it has been already answered in stack overflow as I believe error is with the npm itself not with angular2
Check whether package.json is in your working directory
if not create it by using npm init and try to install angular2 by using npm install #angular/cli command.
If this process didn't work. I think that the issue with npm. This link will help you to debug npm problem.
check this link. Windows 7, npm install -g react-native-cli gives "Cannot read property 'path' of null"
i have refereed to this link and it have the installation problem.this is the procedure [https://github.com/npm/npm/issues/15348)
use the following commands .
npm config set proxy proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
npm config set proxy null 4npm config set https-proxy null
npm config set strict-ssl false
you can check your network connection in case of proxy problem when using npm using the following commands
npm config get registry
npm config get http-proxy
npm config get https-proxy

npm won't create a symlink for webdriver-manager while using JHipster DevBox

I'm trying to use JHipster with the DevBox at work, so with a proxy.
I think I have everything configured accordingly, but I still can't use JHipster properly.
I want to generate a microservice gateway with Protractor, but when I use yo jhipster or npm install, it gives me the following error:
> example-gateway#0.0.0 postinstall /home/vagrant/workspace/example/example-gateway
> webdriver-manager update
sh: 1: webdriver-manager: not found
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm ERR! Linux 3.13.0-88-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm v3.9.6
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! example-gateway#0.0.0 postinstall: `webdriver-manager update`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the example-gateway#0.0.0 postinstall script 'webdriver-manager update'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the example-gateway package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webdriver-manager update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs example-gateway
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls example-gateway
npm ERR! There is likely additional logging output above.
And with sudo:
npm WARN lifecycle example-gateway#0.0.0~postinstall: cannot run in wd %s %s (wd=%s) example-gateway#0.0.0 webdriver-manager update /home/vagrant/workspace/example/example-gateway
However, I found webdriver-manager in the node_modules/protractor/bin directory, but npm seems to be unable to use it.
Actually, I already succeeded once in generating a microservice gateway with Protractor, but I don't know how: the error about webdriver-manager just disappeared one day. Indeed, there was several other errors (packages that didn't want to be installed), and running npm install over and over again while sometimes installing manually some packages seemed to fix them. However I'm trying to use JHipster on another computer so I need to know how to fix the webdriver-manager error.
I took a look in the node_modules folder of the completed gateway project, and discovered a webdriver-manager symlink inside .bin that wasn't in the same directory of the incomplete gateway project, so I supposed npm used it instead of the one in the node_modules/protractor/bin directory. I created one linking the two in the node_modules/.bin directory of the incomplete gateway project with ln -s ../protractor/bin/webdriver-manager webdriver-manager, and it apparently worked.
The problem is that I'm trying to make the installation and the configuration of the JHipster DevBox somehow automated, so people at work wanting to use it don't have to do it manually. If they have to remember to create a symlink each time they encounter that error, it won't be very practical.
Do you know why npm won't create that symlink himself (or sometime fails to install some packages), and how to fix it in a "clean" way?
Ok I found a solution, but I still don't know exactly why it does this and if their is a cleaner way to fix it.
http://perrymitchell.net/article/npm-symlinks-through-vagrant-windows/
I just replaced the node_modules directory by a symlink to somewhere inside the guest machine, so not in the shared folder with Windows. That way, I skip all the problems caused by Windows. The downside is I have to create the link before generating any project, and to fix that link and download again all the dependencies each time I update the DevBox, because I need to destroy the DevBox to update it.

How to install Blur Admin?

I have been trying to install blur-admin via (git clone https://github.com/akveo/blur-admin.git). But when I install it from git bash as mentioned in the installation guide it shows the following error:
bower ECONFLICT Unable to
find suitable version for angular
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! blur_admin#1.2.0 postinstall: bower install npm ERR! Exit
status 1 npm ERR! npm ERR! Failed at the blur_admin#1.2.0 postinstall
script 'bower install'.
npm ERR! This is most likely a problem with the blur_admin package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR! npm bugs blur_admin
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm ERR! npm owner ls blur_admin
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\blur-admin\npm-debug.log
The issue is because Bower is not installed in your Windows Machine.
Try to install bower before installing this AngularJs template.
Use the following command to install bower:
npm install -g bower
Also check if Gulp - Task automation tool is install or not.
Use the following command to install the same:
npm install -g gulp
Now use npm install to install the project and its Package Dependencies.
To run the application:
gulp serve
Sorry I got a little bit late.
Did you try to move the /bower_components/ folder from the /client/ directory to your root project directory? That worked for me.
First
npm i -g npm
Then delete everything in node_modules. When those are deleted, cd to your directory and
npm install
Worked for me. If you are on OSX or Linux, use sudo.
If you are on Windows, make sure you're running as administrator.
The issue is from Bower, as Bower is not installed into the system.
First install the bower by following:
npm install -g bower
Then run the app by :
gulp serve

Resources