I am not able to install nodemon package - nodemon

Not able to install nodemon package, here are the error messages.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/atulyadav/.npm/_logs/2021-08-31T18_23_33_532Z-debug.log
(base) atulyadav#ATULs-MacBook-Pro my-express-server %

You can do two things
change the permission of /usr/local/lib/node_modules folder or
Try sudo npm install nodemon - g

Use sudo npm install nodemon -g , this should resolve the issue.
Note : It will prompt you to enter your password, you might not see the "letters" you are typing, but keep on typing and hit enter.

Related

Unable to install nodemon globally through terminal, showing an error

If I give as npm install -g nodemon
getting an error as :
checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
Please any suggestions.
You need root permissions: try with
sudo npm install -g nodemon
This is a permission error and you can use sudo, But Running sudo npm install (without -g) will create a local directory that can only be altered by the root user. This can really screw things up for you if you try to do npm <something> in the same directory or project later on.
Even sudo npm install -g with a valid installation target can mess things up for you and make it hard to use npm without sudo under some circumstances in the future particularly if you change your npm configuration midstream.
you can use the following steps to update your local OS:
Set your prefix for global installs, e.g. npm config set prefix ~/.npm
Update your PATH to include ~/.npm/bin. For example: echo 'export PATH="$HOME/.npm/bin:$PATH"' >> ~/.zshrc if you’re using zsh.
See Don’t Use sudo with npm for more information.

Libpostal docker does not run on AWS

I am using libpostal for address parsing.Here is the git link: https://github.com/pasupulaphani/libpostal-docker
This docker image runs perfectly fine on my local machine but once I try and run it on EC2 it fails with below error.
Killed
npm ERR! Linux 4.14.138-114.102.amzn2.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! node-zeromq#1.0.0 start: `DEBUG=libpostal:zeromq* node server.js`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the node-zeromq#1.0.0 start script 'DEBUG=libpostal:zeromq* node server.js'.
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 node-zeromq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! DEBUG=libpostal:zeromq* node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-zeromq
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-zeromq
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/.npm/_logs/2019-10-03T00_30_06_303Z-debug.log
I did reinstall the latest versions of zerorpc, nodejs and npm on the EC2 instance. But still cannot figure out the error.

nodemon installation problem in nodejs using npm

npm ERR! file C:\WINDOWS\system32\cmd.exe;C:\Program
Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;
npm ERR! path C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;
C:\Program Files\nodejs\node_modules\npm\bin;
npm ERR! nodemon#1.18.10 postinstall: node bin/postinstall || exit 0
npm ERR! spawn C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin; ENOENT
npm ERR!
npm ERR! Failed at the nodemon#1.18.10 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\gourav\AppData\Roaming\npm-cache_logs\2019-03-21T00_36_51_224Z-debug.log
first show us how you are installing it, and try run it as admin.

Laravel 5.5 API Authentication (Passport) - cross-env: not found error, when i run npm run dev

I have tried to implement laravel passport authentication in my project, but it's not working. Initially, i have installed laravel5.5 with other configuration and file permissions all the stuff.
To implement passport authentication I have followed laravel documentation Document Url
Following steps, I have done,
composer require laravel/passport
php artisan migrate
php artisan passport:install
I have added this line App\User
use Laravel\Passport\HasApiTokens;
use HasApiTokens, Notifiable;
Routes Added in AuthServiceProvider file inside the boot function
Passport::routes();
Inside the config/auth.php file, I have changed API driver as passport
php artisan vendor:publish --tag=passport-components
Inside this file resources/assets/js/app.js
Vue.component(
'passport-clients',
require('./components/passport/Clients.vue')
);
Vue.component(
'passport-authorized-clients',
require('./components/passport/AuthorizedClients.vue')
);
Vue.component(
'passport-personal-access-tokens',
require('./components/passport/PersonalAccessTokens.vue')
);
npm run dev
When running this command I'm getting an error
$ npm run dev
# dev /var/www/html/local/laravel5.5
npm run development
# development /var/www/html/local/laravel5.5
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
sh: 1: cross-env: not found
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/node" "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/npm" "run" "development"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! # development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the # development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
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 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/local/laravel5.5/npm-debug.log
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/node" "/home/sysadmin/.nvm/versions/node/v6.11.1/bin/npm" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! # dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script 'npm run development'.
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 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/local/laravel5.5/npm-debug.log
You must run in cmd/terminal, from your project folder
npm install --save
and then
npm run dev

Unable to install Ember.js

I am trying to install Ember CLI but I am getting error, I am not getting what exactly I need to do.
I am running the below command to install Ember CLI in my C drive:
npm install -g ember-cli
I am getting the below error:
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" "ember-cli"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
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" "ember-cli"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! path C:\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! Error: EPERM, open 'C:\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM, open 'C:\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6']
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! path: 'C:\\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6' }
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! C:\npm-debug.log
UPDATED:
C:\>npm install -g ember-cli
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" "ember-cli"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! C:\npm-debug.log
I have solved the problem. It was mainly because of the network issues. I have enabled a proxy to be used by node for downloading the files.
This is happening because to install something globally with npm you have to be root or an administrator. In windowns right click on the terminal app and click the run as administrator option. On Mac and linux you would just put sudo before the command