Ian Nato Ian Nato - 1 year ago 276
Node.js Question

Installing angularjs with NPM and NODEJS brings an error in ubuntu 16.04

I am having difficulties installing angularjs version 1.5.7 using npm. i have prepared my package.json file as follows.


"name": "angular",
"version": "1.5.7"


when i enter the following command in the terminal, where my project is located

sudo npm install angular@1.5.7 --save

I Encounter the following error message

npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "angular@1.5.7" "--save"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! code ENOSELF

npm ERR! Refusing to install angular as a dependency of itself
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! /home/nato/angular/npm-debug.log

This is my first time installing angularjs via npm so i don't Know what exactly i am doing wrong.

Answer Source

Try renaming your folder from angular to angular-test or something different than angular. Also, if you have a package.json, check that the package name is different from "angular".

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download