error when installing nodemon on Ubuntu 18.04 - javascript

when i install nodemon with
sudo npm i --save-dev nodemon
i get the following error message:
npm ERR! path /home/dominikpatera/Dropbox/Projekty/Fytwa/server/node_modules/npm/node_modules/abbrev
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/dominikpatera/Dropbox/Projekty/Fytwa/server/node_modules/npm/node_modules/abbrev' -> '/home/dominikpatera/Dropbox/Projekty/Fytwa/server/node_modules/npm/node_modules/.abbrev.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/dominikpatera/.npm/_logs/2018-07-11T09_45_21_545Z-debug.log
can you help me fix it?

Open Terminal and type:
sudo npm install -g nodemon
then
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
you will get an output similar to:
fs.inotify.max_user_watches=524288
fs.inotify.max_user_watches = 524288
After that your nodemon will perfectly work.

At first make sure that on your terminal, you are working on the correct project. you can check this by typing ls and then hit enter.
Then give the command to install nodemon. From the official website of nodemon, we found that, we have to write npm install -g nodemon
But if you fall in problem here, then write this-
sudo npm install -g nodemon

Related

NPM install is not working [code 128]

NPM is not working it's giving permission denied error. Here is the full log:
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github.com/jonschlinkert/resolve-file.git /root/.npm/_cacache/tmp/git-clone-8b5c9e7d
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-8b5c9e7d': Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-04-11T06_46_34_324Z-debug.log
root#ip-172-31-15-60:/var/www/html/itracker# npm install request
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github.com/jonschlinkert/resolve-file.git /root/.npm/_cacache/tmp/git-clone-77c3de2c
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-77c3de2c': Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-04-11T06_47_05_916Z-debug.log
What i tried:
completely removed node and NPM and installed.
sudo chown -R $(whoami) ~/.npm
by following the answer from here: npm throws error without sudo
Note:
I tried to install globally is working. But installing locally is not working.
I tried both sudo and normal user.
try sudo npm install even if you are working on sudo user
Use the latest npm
npm install -g npm

ReactJS + NodeJS: What is error "Pass --update-binary to reinstall or --build-from-source to recompile"?

I transferred a ReactJS + NodeJS project from another computer to a new computer. Then inside the folder, I did npm install in the terminal but getting the following response back.
> fsevents#1.0.14 install /Users/Joshua/Projects/practice_project/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
[fsevents] Success: "/Users/Joshua/Projects/practice_project/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
And on the previous computer, I ran the project via npm run server, but when I do it after npm run server in the project on the new computer, now I am getting:
> practice_project#1.0.0 serve /Users/Joshua/Projects/practice_project
> nodemon server/server.js --ignore components
sh: nodemon: command not found
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "serve"
npm ERR! node v4.6.1
npm ERR! npm v2.15.9
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! practice_project#1.0.0 serve: `nodemon server/server.js --ignore components`
npm ERR! spawn ENOENT
I looked around but can't seem to find the right solution. Tried npm install -g node-gyp but getting tar.unpack untar error.
What could be the issue? Will upvote and accept the answer. Thank you.
In this case, the first message you received is just telling you it's attempting to rebuild the fsevents package for your environment, then realized it already had it built, so stopped the process.
The second message is indicating that you are attempting to run nodemon but it isn't installed. I would hazard a guess that it was installed globally on your previous machine (and therefore not included in the project's package.json). If you want to install it globally again, you'll need to run npm i -g nodemon.

Node.js- "npm install express" error:0906D06C :PEM routines : PEM_read_bio npm

I have installed node.js and it has npm installed along with it. In my windows command prompt,when i write "npm install express", it gives me the following error.How to resolve this?
C:\Users>npm -v
2.11.2
C:\Users>npm install express
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"
"express"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! error:0906D06C:PEM routines:PEM_read_bio:no start line
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:\Users\npm-debug.log
I also got same problem after setting registry problem got resolved.
cmd>> npm set registry registry.npmjs.org
cmd>> npm install
it worked for me.

npm config permission error

I am having permission problems with the npm config command. It seems that for some reason it is trying to change the owner of my ~/.npmrc file. When running npm config set color false, I get the following error:
npm ERR! Error: EPERM, chown '/home/bamboo/.npmrc'
npm ERR! { [Error: EPERM, chown '/home/bamboo/.npmrc'] errno: 50, code: 'EPERM', path: '/home/bamboo/.npmrc' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "config" "set" "color" "false"
npm ERR! cwd /home/bamboo
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/bamboo/.npmrc
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, chown '/home/bamboo/.npmrc'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/bamboo/npm-debug.log
npm ERR! not ok code 0
The file .npmrc has the right permissions and I can edit it manually but I need to do it from the npm config command since it is part of an automated build. I can't seem to find valuable information on that matter. I set the prefix to a directory I own and can install globally without any problem but can't run configure! I am running Ubuntu 14.04.
Does anybody have some ideas?
I had the same problem.
https://github.com/npm/npm/issues/7563
Turns out changing from sudo su to sudo su - when starting the bamboo agent process solved the problem.
Got this problem once.
The .npm directory does not have sufficient permissions. Run the following command:
sudo chown -R $(whoami) ~/.npm

Yeoman Javascript error involving 'mkdir'

I'm setting up a Meanjs instance with a Yeoman generator. When I do 'sudo yo meanjs' everything works fine until it looks like it is trying to make a directory and it fails, any ideas on what is going on here?
SOLINK_MODULE(target) Release/kerberos.node: Finished
> bson#0.2.5 install /Users/xxx/Documents/mean/node_modules/connect-
mongo/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/bson.node
SOLINK_MODULE(target) Release/bson.node: Finished
npm ERR! Error: EACCES, mkdir '/Users/xxx/.npm/uglify-js/2.4.15'
npm ERR! { [Error: EACCES, mkdir '/Users/xxx/.npm/uglify-js/2.4.15']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/xxx/.npm/uglify-js/2.4.15',
npm ERR! parent: 'grunt-contrib-uglify' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/xxx/Documents/mean
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /Users/xxx/.npm/uglify-js/2.4.15
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/xxx/.npm/uglify-js/2.4.15'
npm ERR! not ok code 0
That is a pretty common error.
Yeoman is running the following:
bower install & npm install
Bower install succeeded, however NPM install is failing because of user permissions. Just run:
sudo npm install
The ZenCoder's answer is spot on, but if you want to permanently fix this permissions error, you can follow the tutorial at: https://docs.npmjs.com/getting-started/fixing-npm-permissions
Since you're on a Mac, you could actually avoid npm permissions errors altogether by just installing node instead via homebrew:
brew install node (this will install npm too)
Homebrew installs programs to a directory that doesn't require sudo for write, so you can npm install -g <whatever> freely without it.

Categories

Resources