I'm tryin to create a bower.json file.
I'd normally run bower init which would create the .json file.
Now I'm getting this error when I run bower init
/usr/local/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/Users/jason.dee/.config/configstore/bower-github.json'
You don't have access to this file.
at Error (native)
at Object.fs.openSync (fs.js:634:18)
at Object.fs.readFileSync (fs.js:502:33)
at Object.create.all.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:541:32)
at Object.Module._extensions..js (module.js:550:10)
MacBook-Pro:Ang-js-starter jason.dee$
Try:
sudo chown -R <user>:<user> /home/<user>/.config/configstore
example => sudo chown -R prappo:prappo /home/prappo/.config/configstore
then,
bower init
bower install <package>
Related
I try to install the webapp generator from yeoman but I have got this error :
You don't seem to have a generator with the name webapp installed.
after yo webapp :
npm install -g yo (works fine)
npm install -g generator-webapp (works fine)
yo webapp (does not work)
Here is the command lines (on Mac Os) :
MBP-de-Empon:yo Empon$ npm install -g yo
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/Users/Empon/npm/bin/yo-complete -> /Users/Empon/npm/lib/node_modules/yo/lib/completion/index.js
/Users/Empon/npm/bin/yo -> /Users/Empon/npm/lib/node_modules/yo/lib/cli.js
> yo#1.8.5 postinstall /Users/Empon/npm/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
Everything looks all right!
/Users/Empon/npm/lib
└── yo#1.8.5
MBP-de-Empon:yo Empon$ npm install -g generator-webapp
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/Users/Empon/npm/lib
└── generator-webapp#2.4.1
MBP-de-Empon:yo Empon$ yo webapp
Error webapp
You don't seem to have a generator with the name webapp installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 14 registered generators run yo with the `--help` option.
MBP-de-Empon:yo Empon$
EDIT :
So yeoman searched at usr/local... and the webapp generator was downloaded at /Users/Empon/...
So I copied the content into a new folder with the same name : generator-webapp:
mkdir generator-webapp
cp -a /Users/Empon/npm/lib/node_modules/generator-webapp/. /usr/local/lib/node_modules/generator-webapp/
I tried again yo webapp, and I have got this error now :
So it looks good until this line :
events.js:141
throw er; // Unhandled 'error' event
and a new line appear on the Terminal and I was not being able to complete the sass options :
MBP-de-Empon:yo Empon$ yo webapp
_-----_ ╭──────────────────────────╮
| | │ 'Allo 'allo! Out of the │
|--(o)--| │ box I include HTML5 │
`---------´ │ Boilerplate, jQuery, and │
( _´U`_ ) │ a gulpfile to build your │
/___A___\ /│ app. │
| ~ | ╰──────────────────────────╯
__'.___.'__
´ ` |° ´ Y `
? Which additional features would you like to include? (Press <space> to select)
❯◉ Sass
◉ Bootstrap
◉ Modernizr
events.js:141
throw er; // Unhandled 'error' event
^
TypeError: this.env.adapter.prompt(...).then is not a function
at Base.prompt (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:240:45)
at module.exports.generators.Base.extend.prompting (/usr/local/lib/node_modules/generator-webapp/app/index.js:102:17)
at Object.<anonymous> (/usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:439:23)
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
at /usr/local/lib/node_modules/generator-webapp/node_modules/yeoman-generator/lib/base.js:440:9
at processImmediate [as _immediateCallback] (timers.js:383:17)
MBP-de-Empon:yo Empon$
I recently started building iOS apps using Cordova and I’ve hit a roadblock. After installing nodeJS, git and cordova (with sudo), I created my first app in the Documents folder of my user account.
The first run went perfectly. Everything worked, and adding my dev account to Xcode helped my app to run on the device. I decided I’d spice things up a bit by adding a “before_prepare” hook called 001_c.js in <appName>/hooks/before_prepare folder. This is how the hook begins:
//This is where nodeJS exists
#!/usr/local/bin node
console.log("Changing config");
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
//and so on
When I now build the app, I get this error:
pc295786:master kellster$ cordova build ios Running command:
/Users/kellster/documents/apps/master/hooks/before_prepare/001_c.js
/Users/kellster/documents/apps/master Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at Object.exports.spawn (child_process.js:988:9)
at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:104:31)
at runScriptViaChildProcessSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:188:23)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:131:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:114:20
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
To troubleshoot, I changed the first line of the hook script from
#!/usr/local/bin node
to
#! node
(Because this worked on Windows. node was in global scope). But, this resulted in an ENOENT error:
pc295786:master kellster $ cordova build ios Running command:
/Users/kellster/documents/apps/master/hooks/before_prepare/001_c.js
/Users/kellster/documents/apps/master Error: Hook failed with error
code ENOENT:
/Users/kellster/documents/apps/master/hooks/before_prepare/001_c.js
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:194:23
at _rejected (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:797:24)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:823:30
at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:741:41)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
How do I get this to build? I’d appreciate any suggestions I could try.
Some things to note:
(In my desperation, ) I tried running the following commands, because the "EACCES" type of error. But none of them seemed to have any kind of effect on the result. The build was still failing.
sudo chmod 777 “/Users/kellster/documents/apps/master"
sudo chmod 777 “/usr/local/lib”
sudo chmod 777 "/usr/local/bin/"
chmod 777 "/Users/kellster/documents/apps/master/platforms/"
sudo chmod a+rwx "/Users/kellster/Documents/apps/Master/hooks/before_prepare/001_c.js"
sudo chmod a+rwx "/Users/kellster/Documents/apps/Master/"
sudo chown -R kellster /usr/local/lib/node_modules/cordova
2) Node is installed in
/usr/local/bin
Old answer: #!/usr/local/bin node -> better #!/usr/bin/env node
Updated answer: do not use spaces for referencing node executable instead use:
#!/usr/local/bin/node
Also chmod your script: For example:
chmod 777 hooks/before_prepare/onde.js
where onde.js it is your script. If you're on Mac(my case) or Linux, then your .js must on chmod 777 to avoid EACCES errors.
Tweet: Mike Bostock recently tweeted:
If you like making maps in Illustrator, TopoJSON 1.6.9 supports conversion to SVG. No code
required! https://github.com/mbostock/topojson/blob/master/bin/topojson-svg
——Mike Bostock (#mbostock) 30 Avril 2014
Cool !
Topojson version: on my terminal, I checked the version...
$topojson --version
>1.6.11
$node --version
>v0.10.25
Seems good.
Topojson-svg trial: so I gave it a shoot...
curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file
topojson-svg -o output.svg uk.topo.json #this fails
Error: I get a corrupt .svg file together with this ugly error message
fs.js:393
binding.close(fd, makeCallback(callback));
^
TypeError: Bad argument
at Object.fs.close (fs.js:393:11)
at Object.<anonymous> (/home/yug/local/lib/node_modules/topojson/bin/topojson-svg:85:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
Question: How to process to successfully use topojson-svg ?
Edit: also occured with recently installed local (non-global) /node_module :
npm install topojson #locally install topojson.js & topojson-svg
curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file
node_modules/.bin/topojson-svg -o output.svg uk.topo.json #this fails
Fixed on github within 4minutes after reporting the issue.
Will be available within hours/days on npm, with topojson v.1.6.12+
Getting an error when I try to install dos2unix via homebrew. brew doctor has no suggestions, and other install work like a charm. No idea where to start tracing it.
$ brew install dos2unix
==> Downloading http://waterlan.home.xs4all.nl/dos2unix/dos2unix-6.0.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/dos2unix-6.0.3.tar.gz
==> make prefix=/usr/local/Cellar/dos2unix/6.0.3 CC=cc CPP=cc CFLAGS= CFLAGS_OS=
cc -DVER_REVISION=\"6.0.3\" -DVER_DATE=\"2013-01-25\" -DVER_AUTHOR=\"'Erwin Waterlander'\" -DDEBUG=0 -I/usr/local/Cellar/gettext/0.18.3.1/include -DD2U_UNICODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DENABLE_NLS -DLOCALEDIR=\"/usr/local/Cellar/dos2unix/6.0.3/share/locale\" -DPACKAGE=\"dos2unix\" -c unix2dos.c -o unix2dos.o
pod2text man/man1/dos2unix.pod > man/man1/dos2unix.txt
/bin/sh: /usr/bin/pod2text: Permission denied
make: *** [man/man1/dos2unix.txt] Error 126
make: *** Waiting for unfinished jobs....
On my system /usr/bin/pod2text had no execution rights. After changing that by executing the following command I had no problem installing dos2unix:
sudo chmod +x /usr/bin/pod2text
Found out about pow just now and trying to install it on a laptop with a 32bit processor. I am running into (hopefully) a minor error.
During the installation from source I get the following error:
*** Installing local configuration files...
mkdir: /Users/username/Library/Application Support: Permission denied
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Command failed: mkdir: /Users/username/Library/Application Support: Permission denied
at ChildProcess.exithandler (child_process.js:102:15)
at ChildProcess.emit (events.js:67:17)
at Socket.<anonymous> (child_process.js:172:12)
at Socket.emit (events.js:64:17)
at Array.<anonymous> (net.js:837:12)
at EventEmitter._tickCallback (node.js:126:26)
pow#0.3.2 /usr/local/lib/node_modules/pow
├── log#1.2.0
├── async#0.1.8
├── coffee-script#1.1.2
├── nack#0.13.1 (netstring#0.2.0)
└── connect#1.7.1
I have tried to change the permissions on the application support folder using:
sudo chmod 777 ~/Library/Application\ Support/
and can verify the permissions using:
ls -la ~/Library/ | less
I get the following:
drwxrwxrwx+ 15 username blah 510 26 Sep 19:16 Application Support
Can anyone point me in the right direction as I seem to have hit a brick wall thanks
From completly unrelated git issue:
sudo chown -R $USER /usr/local/
& then run install without sudo
npm -g install
Worked for me...