Installing gulp with npm - node.js

i am trying to install gulp via npm on DigitalOcean droplet with following command (with and without sudo):
npm install -g gulp
and im getting errors i cant figure out:
> v8flags#1.0.5 install /root/local/lib/node_modules/gulp/node_modules/v8flags
> node fetch.js
sh: 1: node: Permission denied
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/root/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v0.10.33
npm ERR! npm v2.1.11
npm ERR! code ELIFECYCLE
npm ERR! v8flags#1.0.5 install: `node fetch.js`
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the v8flags#1.0.5 install script 'node fetch.js'.
npm ERR! This is most likely a problem with the v8flags package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node fetch.js
npm ERR! You can get their info via:
npm ERR! npm owner ls v8flags
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/local/bin/npm-debug.log
The node install is made according to this guide.

I had the same issue, installing an earlier version of gulp worked for me:
sudo npm install -g gulp#3.8.8
Found this here: http://forum.ionicframework.com/t/osx-error-v8flags-after-npm-update-ionic/13905/5
Also tried a bunch of other solutions involving solutions as mentioned here:
NPM cannot install dependencies - Attempt to unlock something which hasn't been locked
None of that worked for me.
The error I was getting was this:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
/
node.js:815
var cwd = process.cwd();
^
Error: EACCES, permission denied
at Function.startup.resolveArgv0 (node.js:815:23)
at startup (node.js:58:13)
at node.js:906:3

Related

Trying to install npm on Raspberry Pi Error

I am working on a simple smart mirror project with javascript and electron. I was able to get the software working on my laptop but when I moved it to the raspberry pi I am having issues installing npm. After entering "npm install" I get this:
npm WARN package.json bcrypt-pbkdf#1.0.1 No repository field.
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'types/jquery' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'smart-mirror-server'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 4.9.24-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/Desktop/smart-connected-mirror-master
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/Desktop/smart-connected-mirror-master/npm-debug.log
npm ERR! not ok code 0
I have tried
sudo apt-get update
as well as
sudo apt-get upgrade
Any ideas what to do? Thanks!
EDIT:
I updated the node.js to a more current version and now it installed without error. However, when I typed in the command
npm start
I get this:
sh: 1: electron: Permission denied
npm ERR! Linux 4.9.24-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! smart-mirror-server#1.0.0 start: `electron .`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the smart-mirror-server#1.0.0 start script 'electron .'.
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 smart-mirror- server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs smart-mirror-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls smart-mirror-server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/.npm/_logs/2017-05-29T03_33_22_466Z-debug.log
Have you seen this issue? Electron works only on RaspberryPi 2/3 what version are you using?
Also have you run npm install before actually run the app? Sometimes when copying node_modules from OS to OS the executable permissions get very confused.
You can try a fresh install with: rm -rf node_modules && npm install

I can't update electron with npm

I cannot update electron-prebuilt.
I executed sudo npm update electron-prebuilt -g many times.
But, The Permission denied Error occur every time in spite of using sudo.
Why I can't update electron successfully?
iojs3.2.0, OS X 10.10.5
The following is error log.
/usr/local/lib/node_modules/electron-prebuilt/install.js:15
throw err
^
Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/electron-prebuilt/electron-tmp-download-818-1441021602097/electron-v0.31.1-darwin-x64.zip' -> '/Users/user_name/.electron/electron-v0.31.1-darwin-x64.zip'
at Error (native)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "electron-prebuilt" "-g"
npm ERR! node v3.2.0
npm ERR! npm v2.14.1
npm ERR! code ELIFECYCLE
npm ERR! electron-prebuilt#0.31.1 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-prebuilt#0.31.1 postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /usr/local/lib/node_modules/npm-debug.log
The issue is reported at https://github.com/mafintosh/electron-prebuilt/issues/48 and a workaround seems to be to first install without the -g flag which will get the file into user folder first, and then install again with -g.
EDIT: I guess somehow the permissions are messed up and I'm doing chmod. It seems that if I chmod not only for the user myself but also for group and others it works. Maybe others could also give it a try?
I had the same problem in OS X. I fixed it deleting the ~/.electron folder

Why do i have to call npm link as administrator?

I installed some nodejs packages globally via
sudo npm install gulp -g
Now I (or another developer on the same machine) wants to use it in a project with
me#host:/my/project$ npm link gulp
It fails with
unbuild gulp#3.8.11
npm ERR! Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js'
npm ERR! { [Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js']
npm ERR! errno: 50,
npm ERR! code: 'EPERM',
npm ERR! path: '/my/projectnode_modules/gulp/bin/gulp.js' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.2.0-4-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "link" "gulp"
npm ERR! cwd /raid5/workspaces/jgr/aktivglueck-laravel
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /my/projectnode_modules/gulp/bin/gulp.js
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /my/projectnpm-debug.log
npm ERR! not ok code 0
With
sudo npm link gulp
everything works fine.
What I want to know is: Why does npm link need admin permissions? In my understanding I am creating a link inside my project folder where I have full permissions - so what does it do on the global system?
I believe npm link creates a symlink to the current directory in wherever your globally installed node packages are. See here.
If you don't have write rights to that path (you can check with npm config get prefix) you'll get the error you see there.
To avoid having to sudo global installs/links, you could change the ownership/rights of that directory.

NPM package issues when running meteor app

Right now, I'm trying to get Telescope to run locally on my Mac. I go through all the steps, but once I type in
meteor
in terminal, this is what I get:
=> Started proxy.
=> Started MongoDB.
fast-render: updating npm dependencies -- connect...
npm ERR! Error: EACCES, open '/Users/Justin/.npm/inherits/2.0.1/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/Justin/.npm/inherits/2.0.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Justin/.npm/inherits/2.0.1/package/package.json',
npm ERR! parent: 'readable-stream' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.3.0
npm ERR! command "/Users/Justin/.meteor/tools/cef2bcd356/bin/node" "/Users/Justin/.meteor/tools/cef2bcd356/bin/npm" "install" "connect#2.13.0"
npm ERR! cwd /Users/Justin/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e/.npm/package-new-26ztfl
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/Justin/.npm/inherits/2.0.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Justin/.npm/inherits/2.0.1/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Justin/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e/.npm/package-new-26ztfl/npm-debug.log
npm ERR! not ok code 0
=> Errors prevented startup:
While building package `fast-render`:
error: couldn't install npm package
While building package `telescope-tags`:
error: no such package: 'iron-router'
While building package `telescope-search`:
error: no such package: 'iron-router'
Any help would be great. Thanks.
This worked for me: https://github.com/meteor/meteor/issues/893
From the post:
"Looking in my .meteor/local directory, I saw that .meteor/local/build was owned by root instead of my normal user. Running a sudo rm -r build from within .meteor/local fixed the problem."

CoffeeScript Installing with NPM and Node [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
error installing coffeescript on mac 10.7.2
At the moment, I am trying to install CoffeeScript on my computer. I have node.js version 0.6.7 and npm 1.1.0-beta-10. When i run the command npm install -g coffee-script, it shows this error.
npm http GET https://registry.npmjs.org/coffee-script
npm http 200 https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/coffee-script/-/coffee-script-1.2.0.tgz
npm http 200 https://registry.npmjs.org/coffee-script/-/coffee-script-1.2.0.tgz
npm ERR! Could not create /usr/local/lib/node_modules/___coffee-script.npm
npm ERR! error installing coffee-script#1.2.0
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.0.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "coffee-script"
npm ERR! cwd /Users/Solomon
npm ERR! node -v v0.6.7
npm ERR! npm -v 1.1.0-beta-10
npm ERR! path /usr/local/lib/node_modules/___coffee-script.npm
npm ERR! code EACCES
npm ERR! message EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Solomon/npm-debug.log
How do I fix this?
Error: EACCES, permission denied '/usr/local/lib/node_modules/___coffee-script.npm'
That means you dont have access, so run as root
$ sudo npm install -g coffee-script
(Bonus points for alternatively, not using coffeescript (it's a horrible thing))
The permission denied part is your hint that the installer needs privileges that it doesn't have. Try running as root, i.e.
sudo npm install coffee-script

Resources