coffee-script is not installing on amazon ec2 - node.js

I am using mac terminal to access my amazon ec2 free tier. I installed node and npm using commands.
but when I tried to install Coffee-Script using below command, it gives error and warnings. I don't know what to do. Please help me.
[ec2-user#ip-xxx-xx-xx-xxx /]$ npm install -g coffee-script
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── coffee-script#1.10.0
npm ERR! Linux 4.4.11-23.53.amzn1.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "coffee-script"
npm ERR! node v6.3.1
npm ERR! npm v3.10.3
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 4.4.11-23.53.amzn1.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "coffee-script"
npm ERR! node v6.3.1
npm ERR! npm v3.10.3
npm ERR! path npm-debug.log.3173130556
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.3173130556'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, open 'npm-debug.log.3173130556'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.3173130556' }
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! /npm-debug.log
Also I tried :
[ec2-user#ip-xxx-xx-xx-xx /]$ sudo npm install -g coffee-script
sudo: npm: command not found

Your NPM installation is in a privileged space forcing you to use sudo to make any changes. The problem, is that you're PATH isn't being passed to the sudo'd shell.
You can modify the sudoers PATH by editing the secure_path field in /etc/sudoers.
If you just want to get it installed, provide the full path to npm.
sudo $(which npm) install -g coffee-script

Related

Ubuntu Configuration for Google code labs Errors

joseph#joseph-APSO:/$ npm install
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! Linux 4.13.0-41-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path /node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/node_modules'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/node_modules']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Linux 4.13.0-41-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path npm-debug.log.3678993639
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.3678993639'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, open 'npm-
debug.log.3678993639']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: 'npm-debug.log.3678993639' }
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! /npm-debug.log
You would need elevated permissions, try sudo npm install
Many errors to follow, finally listening to port after all this commands.
npm init
npm install
npm install -g express
<Change root>
root#joseph-APSO:~# npm install npm#latest -g
root#joseph-APSO:/home/joseph/Downloads/sheets-api-master/start# npm install
sudo apt-get install nodejs
root#joseph-APSO:/home/joseph/Downloads/sheets-api-master/start# sudo apt-get install sqlite3 libsqlite3-dev
npm install nw-gyp -g
npm rebuild
npm install sqlite3
root#joseph-APSO:/home/joseph/Downloads/sheets-api-master/start# npm start

Error in installing Firebase in npm for Web hosting

I try to install a Firebase in npm but It's not works well.
I only copy and paste $ npm install -g firebase-tools.
After I got this message
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "firebase-tools"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! path ../lib/node_modules/firebase-tools/bin/firebase
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/bin/firebase' -> '/usr/local/bin/firebase'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/bin/firebase' -> '/usr/local/bin/firebase'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/firebase-tools/bin/firebase',
npm ERR! dest: '/usr/local/bin/firebase' }
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! /Users/hansangjun/npm-debug.log
npm ERR! code 1
You are running it as normal user. Run the same with following command
sudo npm install -g firebase-tools

How to install create-react-app through terminal

I am installing create-react-app through terminal. I have checked the node.js version is 4.5.0, which is higher than the requirement here. and the version of npm is 2.15.9. Then I type the command npm install -g create-react-app, there came out such error information:
npm ERR! tar.unpack untar error /Users/xiufenxu/.npm/create-react-app/0.6.0/package.tgz
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "create-react-app"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! path /usr/local/lib/node_modules/create-react-app
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/create-react-app'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/create-react-app']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/create-react-app',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/create-react-app',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR! 'FSReqWrap.oncomplete (fs.js:82:15)' ] }
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! /Users/xiufenxu/Documents/UM courses/Fall 2016/CSCI 5117/npm-debug.log
I wondering why I got such errors. Is there anyone who can help me to figure out this problem? Thank you so much!
sudo npm install -g create-react-app
you're running it as a user without root permissions
Restarting my computer fixed it for me

Installing express in Terminal on Mac

I get this code. I am on a Mac. I have installed npm. I am an Admin. What am I doing wrong? I've been googling for hours.
Matts-MacBook-Pro-3:Start Matt$ npm install express-generator -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/express-generator
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── express-generator#4.13.1
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express-generator" "-g"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! path /usr/local/lib/node_modules/express-generator
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/express-generator'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/express-generator']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/express-generator' }
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! /Users/Matt/Start/Start/npm-debug.log
Matts-MacBook-Pro-3:Start Matt$
Try clearing the npm cache and try the npm install again. You can use the following to clear the npm cache.
npm cache clean <path to express-generator>
Sometimes you get this error even when you are on ssh, the npm registry might be configured to use a different registry for npm packages and that registry might not have a express-generator

npm does not work with sudo

I am trying to install csslint with npm:
npm install -g csslint
and I get this error:
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "node" "/usr/bin/npm" "install" "csslint"
npm ERR! node v0.12.7
npm ERR! npm v2.14.1
npm ERR! path ../csslint/cli.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, symlink '../csslint/cli.js'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, symlink '../csslint/cli.js'] errno: -13, code: 'EACCES', path: '../csslint/cli.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
and when I try with sudo Nothing happens and I do not get any message. (also when I just type sudo npm I see nothing happens.)

Resources