error when npm install - angularjs

I'm a beginner and I'm trying to learn Angular so I'm trying to install a new project with angular-seed. But when I do npm install I get an error that I dont know where is coming from. I have node installed. The version is 5.5.0. Ad this is the error I get in console.
npm verb install Error: Unsupported
npm verb install at checkPlatform (/usr/lib/node_modules/npm/node_modules/npm-install-checks/index.js:46:14)
npm verb install at Array. (/usr/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
npm verb install at LOOP (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
npm verb install at /usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
npm verb install at checkEngine (/usr/lib/node_modules/npm/node_modules/npm-install-checks/index.js:25:10)
npm verb install at Array. (/usr/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
npm verb install at LOOP (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
npm verb install at chain (/usr/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
npm verb install at module.exports.isInstallable (/usr/lib/node_modules/npm/lib/install/validate-args.js:26:3)
npm verb install at resolveWithNewModule (/usr/lib/node_modules/npm/lib/install/deps.js:452:12)
npm verb lock using /home/david/.npm/_locks/staging-7c9a6a9e85daffeb.lock for /home/david/DiabetesApp/angular-seed/node_modules/.staging
npm verb unlock done using /home/david/.npm/_locks/staging-7c9a6a9e85daffeb.lock for /home/david/DiabetesApp/angular-seed/node_modules/.staging
npm verb stack Error: EACCES: permission denied, mkdir '/home/david/DiabetesApp/angular-seed/node_modules/.staging'
npm verb stack at Error (native)
npm verb cwd /home/david/DiabetesApp/angular-seed
npm ERR! Linux 3.13.0-76-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--verbose"
npm ERR! node v5.5.0
npm ERR! npm v3.3.12
npm ERR! path /home/david/DiabetesApp/angular-seed/node_modules/.staging
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/home/david/DiabetesApp/angular-seed/node_modules/.staging'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/home/david/DiabetesApp/angular-seed/node_modules/.staging']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/home/david/DiabetesApp/angular-seed/node_modules/.staging' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm verb exit [ -13, true ]
npm ERR! Please include the following file with any support request:
npm ERR! /home/david/DiabetesApp/angular-seed/npm-debug.log

ISSUE: You (the user) don't have the right set of permissions for the directory.
The instant way out is to run the npm install using sudo, but this may give you the same error, or improper installation.
Solution/Suggestion: Change npm's Default Directory (from official docs)
Back-up your computer before moving forward.
(optional) In case you have a erroneous installation, first uninstall it:
npm uninstall <package-name> # use sudo if you used it while installation
npm cache verify # or, npm cache clean for npm version below 5.x.x
Make a directory for global installations:
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
Open or create a ~/.profile or ~/.bash_profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
Back on the command line, update your system variables, or restart the terminal:
source ~/.profile
(optional) Test: Download a package globally without using sudo.
npm install -g jshint

"Please try running this command again as root/Administrator."
Try sudo npm install.

This is a permission problem. You must fix permissions on this directory, and run npm install without sudo.
cd your_working_directory
sudo chown -R $( whoami ):$( whoami ) .
sudo chmod -R 755 .
npm install

To avoid EACCESS errors do reinstall node and npm with Node Version Manger (as per written in npm documentation).
For furtner details visit this post:
https://stackoverflow.com/a/49126536/5506730

Related

I am trying to install the node-sass but getting error. How can I fix this

While I am trying to install the node-sass I am facing error during installation process. Could someone tell how can I resolve this.
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\node-gyp
npm ERR! dest C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\.node-gyp-fscmffkd
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\node-gyp' -> 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\.node-gyp-fscmffkd'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\node-gyp' -> 'C:\Users\deepe\OneDrive\Documents\Yajnaseni\POC\language\node_modules\.node-gyp-fscmffkd'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\deepe\\OneDrive\\Documents\\Yajnaseni\\POC\\language\\node_modules\\node-gyp',
npm ERR! dest: 'C:\\Users\\deepe\\OneDrive\\Documents\\Yajnaseni\\POC\\language\\node_modules\\.node-gyp-fscmffkd'
npm ERR! }
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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! C:\Users\deepe\AppData\Local\npm-cache\_logs\2020-12-07T07_55_05_230Z-debug.log
have you tried restarting your system
you can also try this
navigate to node modules folder and delete .node-sass
after that execute this command
npm cache verify
npm install
Are you sure you are in the project when you are trying to install node-sass?
I am not sure if it is related. I seem to have problem getting node-sass 5.0.0 to run with reactJs, I am using node-sass#4.14.1.
Have you tried install the version 4.14.1.
npm install node-sass#4.14.1
As mentioned by #Maduekwe Pedro restart the system. Remane or delete the .scss file in the editor and then do
npm cache verify
npm i node-sass

Reactjs installation failed

I just changed a new laptop to MacBook air using Catalina. I was successfully installed Node when I tried install Reactjs but it says 'permission denied' to node file as below:
zulfadliazhar#Zulfadlis-MacBook-Air ~ % npm install -g create-react-app
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules npm ERR! code EACCES npm ERR! syscall
access npm ERR! path /usr/local/lib/node_modules npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access
'/usr/local/lib/node_modules' npm ERR! [Error: EACCES: permission
denied, access '/usr/local/lib/node_modules'] { npm ERR! errno: -13,
npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR!
path: '/usr/local/lib/node_modules' 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/zulfadliazhar/.npm/_logs/2020-05-15T01_03_00_850Z-debug.log
zulfadliazhar#Zulfadlis-MacBook-Air ~ % create-react-app --version
zsh: command not found: create-react-app
Please assist me.
Thank you
You need the sudo rights to install something in -g (it means global) because it will install it here => /usr/local/lib/node_modules
so you just need to retry like this sudo npm install -g create-react-app

I can't install React! How can I fix this?

I'm trying to install React, but I obtain the error below, how can I fix them?
I'm trying to install with:
npm install -g create-react-app
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /home/pedro/.npm/_cacache/tmp/09106e29
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1000:1000 "/home/pedro/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pedro/.npm/_logs/2019-10-25T14_14_48_169Z-debug.log
According to the information provided by the error logs you just need to give the user under which npm package manager is running the proper permission to the folder /home/pedro/.npm.
The command provided as information should to it: sudo chown -R 1000:1000 "/home/pedro/.npm"
You can read a bit more about this folder in what is ~/.npm dir for?

Error in installing :- npm install -g create-react-app

I was going through "Modern React with Redux Course" on Udemy, there instructor asked to install NodeJs first and then to install " npm install -g create-react-app", When i tried to run this command , i got an error :-
npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/nitintushir/.npm/_logs/2019-09-20T15_22_12_437Z-debug.log
then i go through a some questions on stackoverflow, where someone suggests to run this command :-
npm cache clean --force
to which i got :
npm WARN using --force I sure hope you know what you are doing.
then i run the
npm install -g create-react-app
command again , but still got the same error , any solution/suggestion ?
It look like an access right error, you should try running your install as root like:
sudo npm install -g create-react-app
You should use nvm to manage your node and npm versions.
https://github.com/nvm-sh/nvm
This would allow you to globally install node modules without any sudo permission
And also you can change your node version anytime you want with nvm CLI

Installing Yeoman errors

I am new to Ubuntu and to Angular. I am attempting to set up a Yeoman framework. However each time I run the "yo" command. the following errors occur:
Error: EACCES, mkdir '/home/diarmuid/tmp/npm-2997-20XPEB7W'
npm ERR! { [Error: EACCES, mkdir '/home/diarmuid/tmp/npm-2997-20XPEB7W']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/diarmuid/tmp/npm-2997-20XPEB7W',
npm ERR! parent: 'davidmoshertutorial' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.8.0-35-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/diarmuid/AngularTutorial/DavidMosherTutorial
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path /home/diarmuid/tmp/npm-2997-20XPEB7W
npm ERR! code EACCES
npm ERR! errno 3
Does anyone understand how to solve this? I tried to run "sudo yo" however I got response to :
change to change where npm stores global packages by
putting ~/npm/bin in your PATH and running:
npm config set prefix ~/npm
I ran to gedit ~/.profile and edited the file to this:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH:/~/npm/bin"
fi
I am obviously a bit lost. If anyone has any suggestions it would be much appreciated.
Run this command:
sudo chown -R `whoami` ~/tmp
the tmp folder within the home directory should be owned by the user, not by the admin.

Resources