mac sudo npm install -g protractor Error 404 - angularjs

When I run sudo npm install -g protractor, got the error, looks like there's no that folder/files. Is there anyone who knows how to solve the problem? Thanks very much :)
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "protractor"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code E404
npm ERR! 404 no such package available : #types/node
npm ERR! 404
npm ERR! 404 '#types/node' is not in the
npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 It was specified as a dependency of 'protractor'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm install screenshot

This is reproducible on node 6.9.2. I believe it is an error in npm for this version of node.
❯ nvm install 6.9.2 ⏎
Downloading https://nodejs.org/dist/v6.9.2/node-v6.9.2-darwin-x64.tar.xz...
######################################################################## 100.0%
WARNING: checksums are currently disabled for node.js v4.0 and later
Now using node v6.9.2 (npm v3.10.9)
❯ npm i - g #types/node
npm ERR! addLocal Could not install /Users/cnishina/-
npm ERR! Darwin 16.3.0
npm ERR! argv "/Users/cnishina/.nvm/versions/node/v6.9.2/bin/node" "/Users/cnishina/.nvm/versions/node/v6.9.2/bin/npm" "i" "-" "g" "#types/node"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! path /Users/cnishina/-
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/cnishina/-'
npm ERR! enoent ENOENT: no such file or directory, open '/Users/cnishina/-'
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! /Users/cnishina/npm-debug.log
After installing 6.9.3, the error goes away:
❯ nvm install 6.9.3
Downloading https://nodejs.org/dist/v6.9.3/node-v6.9.3-darwin-x64.tar.xz...
######################################################################## 100.0%
WARNING: checksums are currently disabled for node.js v4.0 and later
npm i -g #tNow using node v6.9.3 (npm v3.10.10)
❯ npm i -g #types/node
/Users/cnishina/.nvm/versions/node/v6.9.3/lib
└── #types/node#7.0.1
I also suggest installing the latest node 6. At the time of this post, it is node 6.9.4. I have checked installing #types/node also works for node 6.9.4.

Some people with the same problem found that decreasing the version to 4.0.4 helped. Buts seems a frequent error. Still not a cool solution, but seems to work for some.

Related

Error when installing webpack React and Redux npm

I am following the tutorial on React and Redux on thenewboston Youtube channel, and just can't install dependencies when I navigate to the directory where the files are provided. Here's the link, and I am following exactly the tips from the beginning of the video https://www.youtube.com/watch?v=TSAw5f8mOQs&list=PL6gx4Cwl9DGBbSLZjvleMwldX8jGgXV6a&index=3
This is the error I get:
:~$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/home/joe/package.json'
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 Linux 3.19.0-56-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/joe
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/joe/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/joe/npm-debug.log
npm ERR! not ok code 0
You are missing package.json.
There are two possibilities:
You want to create new package.json
If you want to create a new package.json use npm init command to setup your package.json.
You already have some code with a package.json
If you already got some code from some repo, cd to that directory where you have your package.json and do a npm install or npm i

Angular 2 Quickstart install failing via npm (Link - https://angular.io/docs/js/latest/quickstart.html)

As given in the link I've been trying to get Angular 2 running on my Ubuntu 15.10 machine but I get the following error messages and the install fails.
I also tried to install Angular 2 via the npm package command, that is sudo npm install angular2#2.0.0-alpha.32 but this gave the same sort of errors.
Any help would be appreciated. Thank you.
Here are the errors. The log it mentions at the bottom can't be posted here because it is over a 1000 lines.
sudo npm install
npm WARN package.json angular2-quickstart#1.0.0 No description
npm WARN package.json angular2-quickstart#1.0.0 No repository field.
npm WARN package.json angular2-quickstart#1.0.0 No README data
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'angular/common' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'angular2-quickstart'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 4.2.0-16-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/anshuman/angular2-quickstart
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/anshuman/angular2-quickstart/npm-debug.log
npm ERR! not ok code 0
you must update your node and your npm for the last versions.
node -v
v4.4.7
npm -v
3.10.5
Also try to cleaar your npm cache
npm cache clear

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

Installing yeoman on mac

I'm trying to install yeoman on my mac to develop an angular app.
This is my situation:
node --version && npm --version
v0.10.33
1.4.28
and this is the result of:
sh-3.2# npm install --global yo bower grunt-cli
/var/root/.npm-packages/bin/grunt -> /var/root/.npm-packages/lib/node_modules/grunt-cli/bin/grunt
/var/root/.npm-packages/bin/bower -> /var/root/.npm-packages/lib/node_modules/bower/bin/bower
/var/root/.npm-packages/bin/yo -> /var/root/.npm-packages/lib/node_modules/yo/cli.js
yo#1.3.3 postinstall /var/root/.npm-packages/lib/node_modules/yo
yodoctor
env: node: No such file or directory
npm ERR! yo#1.3.3 postinstall: yodoctor npm ERR! Exit status 127 npm
ERR! npm ERR! Failed at the yo#1.3.3 postinstall script. npm ERR!
This is most likely a problem with the yo package, npm ERR! not with
npm itself. npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor npm ERR! You can get their info via: npm ERR!
npm owner ls yo npm ERR! There is likely additional logging output
above. npm ERR! System Darwin 14.0.0 npm ERR! command "node"
"/usr/local/bin/npm" "install" "--global" "yo" "bower" "grunt-cli" npm
ERR! cwd /Users/francobasilico npm ERR! node -v v0.10.33 npm ERR! npm
-v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0
I've already tried to find the cli.js file but I find lot of them.
Can anyone help me?
Thanks
I had the same error and my problem was that I install yo with sudo.
Follow this guide and install yo without sudo privilege. That should fix your problem.
I guess you have problem with your node version. You should update to 6 or higher.
Yoeman Install prerequisites
Before installing the Fountain Webapp Generator, you will need the following:
Node.js 6 or higher
npm 3 or higher (which comes bundled with Node)
Git
Yoeman Setup

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