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.
Related
I was trying to install Surge in order to publish my project but my terminal gave me the following error message:
npm ERR! code EACCES`
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/surge
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/surge'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/surge'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/surge'
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.
I am not sure what I need to do. I am the administrator of the computer and the command I ran was npm install -g surge. I am on Mac OS Monterey version 12.4
Any help would be much appreciated.
Thanks
works for me like this:
npm i --package-lock-only
npm cache clean --force
npm audit fix --force
I just ran the command it says to.
npm i --package-lock-only
npm audit fix --force
Anytime it give you permission issues then use sudo at start!
Then it showed me 0 vulnerabilities. Anyway, ran again audit fix and again 0 vulnerabilities.
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'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?
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
While installing angularjs on windows 7. It fails with the below message:
C:\angular.js>npm install
npm ERR! git rev-list -n1 ced17cbe52c1412b2ada53160432a5b681f37cd7: fatal: bad o
bject ced17cbe52c1412b2ada53160432a5b681f37cd7
npm ERR! git rev-list -n1 ced17cbe52c1412b2ada53160432a5b681f37cd7:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\nodejs\\\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-
cli.js" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code 128
npm ERR! Command failed: git -c core.longpaths=true rev-list -n1 ced17cbe52c1412
b2ada53160432a5b681f37cd7
npm ERR! fatal: bad object ced17cbe52c1412b2ada53160432a5b681f37cd7
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\angular.js\npm-debug.log
What is the reason for fatal bad object?
If you are installing angular with NPM inside the console window in an IDE like webstorm for example, you can try installing it with your powershell for example, i think that should solve this error.
Resolved!
Issue was with devDependencies "grunt-jasmine-node" mentioned in angularjs package.json file.
Changed it from "grunt-jasmine-node": "git://github.com/vojtajina/grunt-jasmine-node.git#fix-grunt-exit-code" to "grunt-jasmine-node": "~2.0.1"
grunt-jasmine-node was the referring to the fatal object