Issue with installing npm on Ubuntu 16.04 - node.js

I am trying to install babel using the following command:
npm install --save-dev babel-cli
which is throwing the following output.
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.2.3
npm WARN react-essential#1.0.0 No repository field.
npm ERR! Linux 4.4.0-122-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "babel-cli"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path ../babel-cli/bin/babel-doctor.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink
npm ERR! EPROTO: protocol error, symlink '../babel-cli/bin/babel-doctor.js' -> '/code/ReactExampleFiles/Ch02/02_01/start/node_modules/.bin/babel-doctor'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Linux 4.4.0-122-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "babel-cli"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path npm-debug.log.1893237937
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.1893237937' -> 'npm-debug.log'
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! /code/ReactExampleFiles/Ch02/02_01/start/npm-debug.log
On some research - it was suggested to try npm install --no-bin-links, which is still erroring out:
vagrant#ubuntu-xenial:/code/ReactExampleFiles/Ch02/02_01/start$ npm install --no-bin-links
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.2.3
npm WARN react-essential#1.0.0 No repository field.
Please suggest how to fix.

Try update version of npm. npm install npm -g or apt update npm.

Related

spectral-cli instalation in ubuntu getting failed

npm install -g #stoplight/spectral-cli
Giving below error
npm WARN node-fetch#2.6.8 requires a peer of encoding#^0.1.0 but none was installed.
npm ERR! Linux 5.4.0-1094-azure
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "#stoplight/spectral-cli"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib/node_modules/.staging/#types/node-76508090/package.json
npm ERR! code ENOTDIR
npm ERR! errno -20
npm ERR! syscall open
npm ERR! ENOTDIR: not a directory, open '/usr/local/lib/node_modules/.staging/#types/node-76508090/package.json'
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! /azp/npm-debug.log
npm ERR! code 1

Error while starting the backend in the node app.js in angular 6

When I am starting my backend in the angular using the node app.js command in the terminal it shows some error
I tried all the methods like npm-install or npm-install --save
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.2.7
npm WARN optional Skipping failed optional dependency /nodemon/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.2.7
npm WARN mongoose-type-url#1.0.5 requires a peer of mongoose# but none was installed.
npm ERR! Linux 4.15.0-44-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! file /home/suraj/contactly/sales-tool/salesapp/node_modules/.staging/encrypt-36282e46/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token 'n' at 1:3
npm ERR! { name: 'encrypt',
npm ERR! ^
npm ERR! File: /home/suraj/contactly/sales-tool/salesapp/node_modules/.staging/encrypt-36282e46/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! /home/suraj/contactly/sales-tool/salesapp/npm-debug.log
want to fix the bug

I'm having trouble with npm install for angular 2

This is error that I'm getting in cmd prompt:
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> angular2-quickstart#1.0.0 postinstall C:\Users\hp\Desktop\angular2-seed
> typings install
'typings' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN angular2-quickstart#1.0.0 No description
npm WARN angular2-quickstart#1.0.0 No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe"
"C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart#1.0.0 postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart#1.0.0 postinstall script 'typings install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\hp\Desktop\angular2-seed\npm-debug.log
When you see
'typings' is not recognized as an internal or external command, operable program > or batch file.
try to install typings first npm install typings --global
You need to install typings globally:
- npm i typings -g

npm install error when following Angular2 5 min quickstart

I get an error when following the Angular2 5 min quick start. How can I get past it?
vagrant#vagrant-ubuntu-trusty-64:/vagrant/angular2-tutorial$ sudo npm install angular2-quickstart#1.0.0 /vagrant/angular2-tutorial
└── foxy#11.1.4 extraneous
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.6
npm WARN angular2-quickstart#1.0.0 No description
npm WARN angular2-quickstart#1.0.0 No repository field.
npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v5.4.0
npm ERR! npm v3.5.2
npm ERR! path /vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename '/vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7' -> '/vagrant/angular2-tutorial/node_modules/browser-sync/node_modules/lodash'
npm ERR! at destStatted (/usr/local/lib/node_modules/npm/lib/install/action/finalize.js:25:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:82:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename '/vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7' -> '/vagrant/angular2-tutorial/node_modules/browser-sync/node_modules/lodash'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, rename '/vagrant/angular2-tutorial/node_modules/.staging/lodash-496d43d7' -> '/vagrant/angular2-tutorial/node_modules/browser-sync/node_modules/lodash'] parent: 'browser-sync' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 3.13.0-74-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v5.4.0
npm ERR! npm v3.5.2
npm ERR! path npm-debug.log.727051537
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename
npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.727051537' -> 'npm-debug.log'
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! /vagrant/angular2-tutorial/npm-debug.log
Here is the error log:
https://www.dropbox.com/s/xr6ha3z4re0npvi/npm-debug.log.727051537?dl=0
It looks like this is the permission issue. The npm is configured to put downloaded modules to a directory that is not authorized.
You can configure npm to install the modules to a custom directory with its prefix configuration.
Refer to following articles:
Use one of these techniques to install node and npm without having to sudo
Installing Node and npm

Install package using npm

I am trying to install npm using :
sudo npm install azure#0.6.9
npm http GET https://registry.npmjs.org/azure/0.6.9
npm http 304 https://registry.npmjs.org/azure/0.6.9
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: azure#0.6.9
npm ERR! Required: {"node":">= 0.6.15"}
npm ERR! Actual: {"npm":"1.1.4","node":"0.6.12"}
npm ERR!
npm ERR! System Linux 3.2.0-31-virtual
npm ERR! command "node" "/usr/bin/npm" "install" "azure#0.6.9"
npm ERR! cwd /home/azureuser/nvm/bin
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! code ENOTSUP
npm ERR! message Unsupported
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/azureuser/nvm/bin/npm-debug.log
npm not ok
$ node --version
v0.8.16
not sure where it is getting the version number from (or) why is the use in nvm also not taking into effect. Can you please let me know what I am missing

Resources