A bit of a long one but I figure including as much info as I can will give me the best chance of getting a solution.
I am on OSX 10.11.6 El Capitan.
I have Hombrew installed and Node, npm and git via Homebrew.
I have xcode and command line tools installed.
$ brew -v
Homebrew 0.9.9 (git revision 09929; last commit 2016-09-15)
Homebrew/homebrew-core (git revision 08ce; last commit 2016-09-15)
$ node -v
v6.5.0
$ which node
/usr/local/bin/node
$ npm -v
3.10.3
$ which npm
/usr/local/bin/npm
I seem to be able to install bower without issue:
$ npm install -g bower
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
/usr/local/lib
└── bower#1.7.9
But then I run bower -v to check my install and I run in to a problem:
$ bower -v
/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/Users/username/.config/configstore/bower-github.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at Object.get (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:35:26)
at Object.Configstore (/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:28:44)
at readCachedConfig (/usr/local/lib/node_modules/bower/lib/config.js:19:23)
at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:12)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/index.js:16:32)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
So I run these commands:
$ sudo chown -R $USER:$GROUP ~/.npm
$ sudo chown -R $USER:$GROUP ~/.config
And then I run bower -v again:
$ bower -v
1.7.9
It looks to be sorted until I try and install my first package:
$ bower install bootstrap --save-dev
bower bootstrap#* not-cached
https://github.com/twbs/bootstrap.git#*
bower bootstrap#* resolve https://github.com/twbs/bootstrap.git#*
bower bootstrap#* checkout v3.3.7
bower bootstrap#* progress Receiving objects: 19% (78/409)
bower bootstrap#* progress Receiving objects: 46% (189/409), 708.00 KiB | 703.00 KiB/s
bower bootstrap#* progress Receiving objects: 49% (201/409), 1.73 MiB | 883.00 KiB/s
bower bootstrap#* EACCES EACCES: permission denied, open '/Users/username/.cache/bower/packages/478ab1d28ba78f550601bf536eea62f5-3.3.7.lock'
Stack trace:
Error: EACCES: permission denied, open '/Users/username/.cache/bower/packages/478ab1d28ba78f550601bf536eea62f5-3.3.7.lock'
at Error (native)
Console trace:
Error
at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:81:37)
at Logger.<anonymous> (/usr/local/lib/node_modules/bower/lib/bin/bower.js:110:26)
at emitOne (events.js:96:13)
at Logger.emit (events.js:188:7)
at Logger.emit (/usr/local/lib/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/bower/lib/commands/index.js:48:20
at _rejected (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:844:24)
at /usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:870:30
at Promise.when (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:1122:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:788:41)
System info:
Bower version: 1.7.9
Node version: 6.5.0
OS: Darwin 15.6.0 x64
This is where I'm getting stuck. Any help solving this would be much appreciated.
I'm using El Capitan too. I had to delete the directory to manage to make it work.
sudo rm -rf ~/.config/
After trying all of the options, like chown and chmod, the only way was removing the directory. But I don't know if this is the best option.
sudo bower install --allow-root bootstrap
Related
I've followed the instructions verbatim to install gauge from "https://gauge.org/getting-started-guide/quick-install/" and I'm unable to install it.
I'm starting from a fresh GCP Debian instance. After installing the NodeJS PPM and then following the instructions, "gauge" is installing a blank file under /usr/lib/node_modules/#getgauge/cli/bin. I'm getting the following file permission error. This is all run as root.
root#instance-1:~# npm -v
6.9.0
root#instance-1:~# node -v
v10.16.3
root#instance-1:~# npm install -g npm#latest
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ npm#6.11.2
added 19 packages from 13 contributors, removed 15 packages and updated 53 packages in 6.895s
root#instance-1:~# npm install -g #getgauge/cli
/usr/bin/gauge -> /usr/lib/node_modules/#getgauge/cli/bin/gauge
> #getgauge/cli#1.0.5 install /usr/lib/node_modules/#getgauge/cli
> node ./src/index.js
Fetching download url for Gauge version 1.0.5
Downloading https://github.com/getgauge/gauge/releases/download/v1.0.5/gauge-1.0.5-linux.x86_64.zip to ./bin
{ [Error: EACCES: permission denied, open 'bin/gauge'] errno: -13, code: 'EACCES', syscall: 'open', path: 'bin/gauge' }
+ #getgauge/cli#1.0.5
added 83 packages from 76 contributors in 6.48s
Version information
root#gauge:~/gaugetest$ npm -v
6.11.2
root#gauge:~/gaugetest$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.9 (stretch)
Release: 9.9
Codename: stretch
Any ideas?
npm changes the uid to the user account or uid specified by the user config when invoked with root privileges, which defaults to nobody. Set the unsafe-perm flag to run scripts with root privileges.
In your case you can try npm run #getgauge/cli --uynsafe-perm
I am using a windows 8.1 maching,and trying to install the Bower automation tool via Git Bash. So what I found is this:
$ npm config set prefix /usr/local
$ npm install -g bower
$ which bower
>> /usr/local/bin/bower
However after typing the first command gitbash gives me this.
Error: EPERM: operation not permitted, mkdir 'C:\Program Files\Git\usr\local'
at Error (native)
Why is this happening?
Thanks.
When try to ember build or ember serve I get next error:
The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with:
Error: ENOENT: no such file or directory, stat
'/Users/artem_shevtsov/DATA/Projects/laser/ui/tmp/source_map_concat-input_base_path-TNdPSywn.tmp/bower_components/foundation-sites/dist/foundation.js'
at Object.fs.statSync (fs.js:906:18)
at FSMonitor._measure (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/heimdalljs-fs-monitor/index.js:66:21)
at Object.statSync (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/heimdalljs-fs-monitor/index.js:82:30)
at Concat.keyForFile (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-caching-writer/index.js:87:20)
at Array.map (native)
at Concat.CachingWriter._conditionalBuild (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-caching-writer/index.js:109:65)
at /Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/broccoli-plugin/read_compat.js:93:34
at tryCatch (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/Users/artem_shevtsov/DATA/Projects/laser/ui/node_modules/rsvp/dist/rsvp.js:2373:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
I tried npm and bower cache clean, rm -rf tmp node_modules bower_components and plugins reinstallation
Also tried manual installation with npm and bower (npm i foundation-sites, bower install foundation-sites) and add
app.import('node_modules/foundation-sites/dist/js/foundation.js')
app.import('node_modules/foundation-sites/dist/js/foundation.min.js')
(or bower_components/... respectively) but it does not work
❯ npm -v
3.10.9
❯ node -v
v7.2.0
❯ ember -v
v7.2.0
ember-cli: 2.9.0
node: 7.2.0
os: darwin x64
Remove entry for foundation or foundation-sites from package.json and bower.json.
npm cahce clean
bower cache clean
rm -rf tmp node_modules bower_components
npm install && bower install
bower install foundation
remove other entries related foundation from ember-cli-build.js and include below app.import('bower_components/foundation-sites/dist/js/foundation.min.js')
Stop ember server and start it again.
app.import('bower_components/foundation-sites/dist/foundation.min.js', {
type: 'vendor'
});
type: 'vendor' is the secret of success
path can be different, depends on foundation-sites version
I leave package.json and bower.json without any changes
Set the version of foundation-sites to 6.2.2 in bower.json
run bower install
Currently having issues with using Bower on Ubuntu
I attempt to use bower install, bower init and I am advised not to use sudo, but when I do I get the following error
bower EACCES EACCES: permission denied, open '/var/www/xxxxxx/html/wp-content/themes/xxxxxxxx/bower.json'
Stack trace:
Error: EACCES: permission denied, open '/var/www/xxxxxx/html/wp-content/themes/xxxxxxxx/bower.json'
at Error (native)
Console trace:
Error
at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:81:37)
at Logger. (/usr/local/lib/node_modules/bower/lib/bin/bower.js:110:26)
at emitOne (events.js:77:13)
at Logger.emit (events.js:169:7)
at Logger.emit (/usr/local/lib/node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/bower/lib/commands/index.js:48:20
at _rejected (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:844:24)
at /usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:870:30
at Promise.when (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:1122:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/lib/node_modules/q/q.js:788:41)
System info:
Bower version: 1.7.9
Node version: 4.2.6
OS: Linux 4.4.0-36-generic x64
The only thing that works is the following sudo bower install --allow-roots
Is there any way around this ?
You have to have permission to the directory you are trying to install files in. So you have to use bower as a user who has access to this folder (eg www-data on Ubuntu: sudo -u www-data bower install)
While trying to install karma in ubuntu using command
sudo npm install -g karma
i'm getting errors like
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:238:23)
npm ERR! at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/index.js:148:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/index.js:876:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/index.js:827:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:910:16
npm ERR! at process._tickCallback (node.js:415:13)
And a number of errors like
npm ERR! registry error parsing json
And it's not getting installed.Any help would be appreciated.My node.js version is v0.10.13
my npn install karma failed and
i resolved my problems with
sudo ln -s /usr/bin/nodejs /usr/bin/node
on ubuntu 13.10
I had a problem with Ubuntu 12.04 running without sudo, removing the -g option solved the problem installing it locally
npm install karma
npm install
I had the same issue, fixed by downloading the source code for 0.10.15 version. ./configure && make && sudo make install then sudo npm install -g karma and it works!
I have a similar problem installing the karma into the ubuntu inside vagrant. In my case, the install looks good, but don't work as expected.
$ sudo npm install --global karma
$ karma
No command 'karma' found, did you mean:
Command 'karm' from package 'ktimetracker' (main)
karma: command not found
But, looking in the installation output, I could find where the karma was really installed:
/usr/lib/node_modules/karma/bin/karma
If want to just type karma and run, just run:
$ sudo ln -s /usr/lib/node_modules/karma/bin/karma /usr/bin/karma & chmod +x /usr/bin/karma
If anyone needs to install nvm (in order to change node's version), and then Nicolas's instructions:
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
source ~/.profile
nvm ls-remote
nvm install 0.10.15
which node
node --version
sudo npm install karma
node --version
./configure
make
sudo make install
sudo npm install -g karma