Error: npm install -g #angular/cli - angularjs

When I am trying to run this command, it through error and NPM does not install completely.
Before this version of Node.js I also installed node-v8.9.1-x64.msi, but their same issue I was facing that's why I uninstalled and installed node-v6.11.0-x64
But still, I am not able to solve this issue.
Node Version: v6.11.0
NPM Version: 3.10.0
Error Message:
D:\angular\NPM>npm install -g #angular/cli
C:\Users\XXX\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\#a
ngular\cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#
1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm ERR! Windows_NT 6.1.7601
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 v6.11.0
npm ERR! npm v3.10.10
npm ERR! path C:\Users\XXX\AppData\Roaming\npm\node_modules\.staging\rxjs-8d
1ee8eb
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\XXX\AppData
\Roaming\npm\node_modules\.staging\rxjs-8d1ee8eb' -> 'C:\Users\XXX\AppData\R
oaming\npm\node_modules\#angular\cli\node_modules\rxjs'
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\instal
l\action\finalize.js:25:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-f
s\polyfills.js:264:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\XXX\AppData
\Roaming\npm\node_modules\.staging\rxjs-8d1ee8eb' -> 'C:\Users\XXX\AppData\R
oaming\npm\node_modules\#angular\cli\node_modules\rxjs'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\XXX\AppD
ata\Roaming\npm\node_modules\.staging\rxjs-8d1ee8eb' -> 'C:\Users\XXX\AppDat
a\Roaming\npm\node_modules\#angular\cli\node_modules\rxjs'
npm ERR! at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\instal
l\action\finalize.js:25:7)
npm ERR! at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-f
s\polyfills.js:264:29
npm ERR! at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\XXX\AppData
\Roaming\npm\node_modules\.staging\rxjs-8d1ee8eb' -> 'C:\Users\XXX\AppData\R
oaming\npm\node_modules\#angular\cli\node_modules\rxjs'
npm ERR! at Error (native) parent: '#angular/cli' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! D:\angular\NPM\npm-debug.log
npm ERR! code 1

Normally I'd say "use it with sudo" like
sudo npm install -g #angular/cli
But since you are on Windows, try with an elevated command prompt.
In other words: Start your console (CMD) as Administrator and run the command again.
If that doesn't work, type
npm cache clean
And then just run
npm install -g #angular/cli
again.

For Angular 4+ project development, you should use latest node version v8.8.9. So that you won't face any errors related to any modules.

I have same issue while trying to install #angular/cli
I found the node.js version I had installed was 6.10. Then I upgraded my node.js to 8.10.0 and tried:
npm install -g #angular/cli works fine.
The old version of npm doesn't support new features of Angular.

Related

i am getting the following error while installing material-UI in vs code with npm WHAT SHOULD I DO?

npm ERR! node_modules/react
npm ERR! react#"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\ayush tawar\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ayush tawar\AppData\Local\npm-cache_logs\2022-06-10T07_31_54_848Z-debug-0.log
PS C:\Users\ayush tawar\OneDrive\Desktop\twitter clone>
Please try to do like this
npm cache clean
and then
npm install -g node-gyp
npm install --g --production windows-build-tools
Error installing bcrypt with npm
You can also add --verbose flag at the end of npm install which will show more
information about this issue.
if second command will not work, then you should install python to your pc and install this one.
npm install --g windows-build-tools
I believe if you will use ubuntu or mac os, it will be resolved maybe.
Or it could be node version issue, please upgrade node version.
The package is not up to date for react 18.
Just install it with --legacy-peer-deps, this will override the error checking.
npm install #material-ui/core --legacy-peer-deps

angular-cli is not installed in ubtunu 16.04

I have tried multiple times to install angular-cli in my ubuntu 16.04, but everytime I got failed. I am using node version 6.9.1 and npm version 3.10.8. I'm enclosing the errors here in this post.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/angular-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.0.14: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN #angular/compiler-cli#0.6.4 requires a peer of #angular/compiler#2.0.2 but none was installed.
npm WARN #angular/compiler-cli#0.6.4 requires a peer of #angular/platform-server#2.0.2 but none was installed.
npm WARN #angular/compiler-cli#0.6.4 requires a peer of #angular/core#2.0.2 but none was installed.
npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli#latest"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-e9ea1451
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-e9ea1451' -> '/usr/local/lib/node_modules/angular-cli/node_modules/npm/node_modules/abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-e9ea1451' -> '/usr/local/lib/node_modules/angular-cli/node_modules/npm/node_modules/abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/pc/Downloads/node-v6.9.1/npm-debug.log
npm ERR! code 1
Does anyone have a fix?
https://github.com/angular/angular-cli/issues/1190
Try running
sudo npm uninstall -g angular-cli
sudo npm install-g angular-cli

Error npm install concurrently lite-server typescript

I'm trying to fix the npm start trouble on angular's quick start so I tried to install these dependencies. Unfortunately I'm encountering these error messages:
$ sudo npm install -g concurrently lite-server typescript
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "concurrently" "lite-server" "typescript"
npm ERR! node v6.6.0
npm ERR! npm v3.10.8
npm ERR! uid must be an unsigned int
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "concurrently" "lite-server" "typescript"
npm ERR! node v6.6.0
npm ERR! npm v3.10.8
[14 - 16 of this repeatedly appears]
npm ERR! uid must be an unsigned int
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! /Users/username/npm-debug.log
I don't know what this means since I'm just a beginner.
You have to reinstall node.js package
node.js
It solves the issue for me
There are couple of ways to solve this issue. It has to do with permissions.
Listed below is summary of both solutions:
Solution A:
(1) Create npm-global directory under /Users// as /Users//npm-global
(2) npm config set prefix /Users//npm-global
(3) Add export PATH=/Users//npm-global/bin:$PATH to ~/.profile
(4) source ~/.profile
(5) If you don't want to do steps (3) & (4) add the export comment to ~/.bash_profile
or
Solution B:
(1) sudo chown -R $USER /usr/local/
Follow the link https://docs.npmjs.com/getting-started/fixing-npm-permissions for more details

Unable to install Angularjs on Windows 7

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

NPM start throwing errors

Hi I am trying to install and run angular-phonecat project.
install git ( windows ) from github
Opened git shell.cloned the probject.
I have node already installed so I opened node console and typed node --version.I got v0.10.9
back to git shell. did npm install in the angular-phonecat directory ( to install all dependencies as angular js suggests here:https://docs.angularjs.org/tutorial
I got following error then:
npm ERR! Error: No compatible version found: karma-chrome-launcher#'^0.1.4'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5"]
npm ERR! at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\
npm\lib\cache.js:709:10)
npm ERR! at C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:631:
10
npm ERR! at saved (C:\Program Files (x86)\nodejs\node_modules\npm\node_modul
es\npm-registry-client\lib\get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\abc\angular-phonecat
npm ERR! node -v v0.10.9
npm ERR! npm -v 1.2.24
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\abc\angular-phonecat\npm-debug.log
npm ERR! not ok code 0
I have no idea what is wrong ?
----Nov 3 2014 update----I updated Node to version v0.10.33 and started getting below error when trying npm install on angular-phonecat directory.
npm WARN package.json karma-chrome-launcher#0.1.5 No README data
angular-phonecat#0.0.0 postinstall C:\abc\angular-phonecat
bower install
'bower' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! angular-phonecat#0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat#0.0.0 postinstall script.
npm ERR! This is most likely a problem with the angular-phonecat 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 their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\abc\angular-phonecat
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\abc\angular-phonecat\npm-debug.log
npm ERR! not ok code 0
Open your package.json file and change "karma-chrome-launcher": "^0.1.4" with "karma-chrome-launcher": "0.1.4", that is, remove the caret. Same with all the dependencies that use that notation. You can see the meaning of the version numbers here.
https://www.npmjs.org/doc/files/package.json.html#dependencies
The ^ character means "Compatible with".
You can also try to upgrade node and npm, versions 0.10.9 and 1.2.24 are quite old now, and the ^ character is not supported in that version.
Caret was first available in npm from August 2013 and became the
default save prefix 6 months later in February 2014.
Which is npm version 1.3.7.
If it still does not work try npm cache clear and then npm install again.
If your problem is the proxy you can try npm config set proxy and npm config set https-proxy as described here jjasonclark.com/how-to-setup-node-behind-web-proxy.
Hope this helps.
Note: I have tried npm install on a fresh copy of this repository myself and it works, although not Windows and versions 0.10.28 and 1.4.9 respectively. So the package.json is correct, strictly speaking.

Resources