Permissions when running Natal
mfikes opened this issue · 4 comments
(I know next to nothing about Node / iojs, so this could very well be a non-issue.)
In a fresh VM I installed iojs, and then Natal (which complained about permissions, so I ran the npm install command as sudo).
Then:
$ natal FutureApp
Creating FutureApp
Creating Leiningen project
Updating Leiningen project
Compiling ClojureScript
Retrieving lein-cljsbuild/lein-cljsbuild/1.1.0/lein-cljsbuild-1.1.0.pom from clojars
Retrieving lein-cljsbuild/cljs-compat/1.0.0-SNAPSHOT/cljs-compat-1.0.0-20150824.150307-36.pom from clojars
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.pom from central
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom from central
Retrieving fs/fs/1.1.2/fs-1.1.2.pom from clojars
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.pom from central
Retrieving org/apache/commons/commons-compress/1.3/commons-compress-1.3.pom from central
Retrieving org/apache/commons/commons-parent/22/commons-parent-22.pom from central
Retrieving org/apache/apache/9/apache-9.pom from central
Retrieving org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar from central
Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.jar from central
Retrieving lein-cljsbuild/lein-cljsbuild/1.1.0/lein-cljsbuild-1.1.0.jar from clojars
Retrieving lein-cljsbuild/cljs-compat/1.0.0-SNAPSHOT/cljs-compat-1.0.0-20150824.150307-36.jar from clojars
Retrieving fs/fs/1.1.2/fs-1.1.2.jar from clojars
Retrieving cljsbuild/cljsbuild/1.1.0/cljsbuild-1.1.0.pom from clojars
Retrieving org/clojure/clojurescript/0.0-2411/clojurescript-0.0-2411.pom from central
Retrieving org/sonatype/oss/oss-parent/7/oss-parent-7.pom from central
Retrieving org/clojure/clojure/1.6.0/clojure-1.6.0.pom from central
Retrieving com/google/javascript/closure-compiler/v20140625/closure-compiler-v20140625.pom from central
Retrieving com/google/javascript/closure-compiler-parent/v20140625/closure-compiler-parent-v20140625.pom from central
Retrieving org/sonatype/oss/oss-parent/9/oss-parent-9.pom from central
Retrieving com/google/javascript/closure-compiler-externs/v20140625/closure-compiler-externs-v20140625.pom from central
Retrieving args4j/args4j/2.0.26/args4j-2.0.26.pom from central
Retrieving args4j/args4j-site/2.0.26/args4j-site-2.0.26.pom from central
Retrieving org/kohsuke/pom/6/pom-6.pom from central
Retrieving com/google/guava/guava/17.0/guava-17.0.pom from central
Retrieving com/google/guava/guava-parent/17.0/guava-parent-17.0.pom from central
Retrieving com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.pom from central
Retrieving com/google/google/1/google-1.pom from central
Retrieving org/json/json/20090211/json-20090211.pom from central
Retrieving com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom from central
Retrieving org/clojure/google-closure-library/0.0-20140718-946a7d39/google-closure-library-0.0-20140718-946a7d39.pom from central
Retrieving org/clojure/google-closure-library-third-party/0.0-20140718-946a7d39/google-closure-library-third-party-0.0-20140718-946a7d39.pom from central
Retrieving org/clojure/data.json/0.2.3/data.json-0.2.3.pom from central
Retrieving org/clojure/pom.contrib/0.1.2/pom.contrib-0.1.2.pom from central
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom from central
Retrieving org/mozilla/rhino/1.7R4/rhino-1.7R4.pom from central
Retrieving org/clojure/tools.reader/0.8.10/tools.reader-0.8.10.pom from central
Retrieving clj-stacktrace/clj-stacktrace/0.2.5/clj-stacktrace-0.2.5.pom from clojars
Retrieving org/clojure/clojure/1.7.0/clojure-1.7.0.pom from central
Retrieving org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.pom from central
Retrieving com/google/javascript/closure-compiler/v20150729/closure-compiler-v20150729.pom from central
Retrieving com/google/javascript/closure-compiler-parent/v20150729/closure-compiler-parent-v20150729.pom from central
Retrieving com/google/javascript/closure-compiler-externs/v20150729/closure-compiler-externs-v20150729.pom from central
Retrieving com/google/guava/guava/18.0/guava-18.0.pom from central
Retrieving com/google/guava/guava-parent/18.0/guava-parent-18.0.pom from central
Retrieving com/google/code/gson/gson/2.2.4/gson-2.2.4.pom from central
Retrieving org/clojure/google-closure-library/0.0-20150805-acd8b553/google-closure-library-0.0-20150805-acd8b553.pom from central
Retrieving org/clojure/google-closure-library-third-party/0.0-20150805-acd8b553/google-closure-library-third-party-0.0-20150805-acd8b553.pom from central
Retrieving org/clojure/data.json/0.2.6/data.json-0.2.6.pom from central
Retrieving org/mozilla/rhino/1.7R5/rhino-1.7R5.pom from central
Retrieving org/clojure/tools.reader/0.10.0-alpha3/tools.reader-0.10.0-alpha3.pom from central
Retrieving org/omcljs/om/0.9.0/om-0.9.0.pom from clojars
Retrieving cljsjs/react/0.13.3-0/react-0.13.3-0.pom from clojars
Retrieving org/omcljs/ambly/0.6.0/ambly-0.6.0.pom from clojars
Retrieving org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.pom from central
Retrieving com/google/javascript/closure-compiler/v20150126/closure-compiler-v20150126.pom from central
Retrieving com/google/javascript/closure-compiler-parent/v20150126/closure-compiler-parent-v20150126.pom from central
Retrieving com/google/javascript/closure-compiler-externs/v20150126/closure-compiler-externs-v20150126.pom from central
Retrieving com/google/truth/truth/0.24/truth-0.24.pom from central
Retrieving com/google/truth/truth-parent/0.24/truth-parent-0.24.pom from central
Retrieving junit/junit/4.10/junit-4.10.pom from central
Retrieving org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.pom from central
Retrieving org/hamcrest/hamcrest-parent/1.1/hamcrest-parent-1.1.pom from central
Retrieving org/clojure/tools.reader/0.8.16/tools.reader-0.8.16.pom from central
Retrieving com/github/rickyclarkson/jmdns/3.4.2-r353-1/jmdns-3.4.2-r353-1.pom from central
Retrieving org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.pom from central
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.pom from clojars
Retrieving com/google/javascript/closure-compiler/v20150729/closure-compiler-v20150729.jar from central
Retrieving com/google/javascript/closure-compiler-externs/v20150729/closure-compiler-externs-v20150729.jar from central
Retrieving org/clojure/clojurescript/1.7.122/clojurescript-1.7.122.jar from central
Retrieving org/clojure/clojure/1.7.0/clojure-1.7.0.jar from central
Retrieving com/google/guava/guava/18.0/guava-18.0.jar from central
Retrieving args4j/args4j/2.0.26/args4j-2.0.26.jar from central
Retrieving com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar from central
Retrieving com/google/code/gson/gson/2.2.4/gson-2.2.4.jar from central
Retrieving com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar from central
Retrieving org/clojure/google-closure-library-third-party/0.0-20150805-acd8b553/google-closure-library-third-party-0.0-20150805-acd8b553.jar from central
Retrieving org/clojure/google-closure-library/0.0-20150805-acd8b553/google-closure-library-0.0-20150805-acd8b553.jar from central
Retrieving org/clojure/data.json/0.2.6/data.json-0.2.6.jar from central
Retrieving org/mozilla/rhino/1.7R5/rhino-1.7R5.jar from central
Retrieving org/clojure/tools.reader/0.10.0-alpha3/tools.reader-0.10.0-alpha3.jar from central
Retrieving com/github/rickyclarkson/jmdns/3.4.2-r353-1/jmdns-3.4.2-r353-1.jar from central
Retrieving org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar from central
Retrieving clj-stacktrace/clj-stacktrace/0.2.5/clj-stacktrace-0.2.5.jar from clojars
Retrieving cljsbuild/cljsbuild/1.1.0/cljsbuild-1.1.0.jar from clojars
Retrieving org/omcljs/om/0.9.0/om-0.9.0.jar from clojars
Retrieving org/omcljs/ambly/0.6.0/ambly-0.6.0.jar from clojars
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar from clojars
Retrieving cljsjs/react/0.13.3-0/react-0.13.3-0.jar from clojars
Creating React Native skeleton
EACCES: permission denied, mkdir '/usr/local/lib/node_modules/natal/node_modules/react-native/Examples/FutureApp'
As a follow-on, I think I really need to address the underling permissions problem, as I can't just run the above as sudo:
$ sudo natal FutureApp
Creating FutureApp
Creating Leiningen project
Updating Leiningen project
Compiling ClojureScript
Creating React Native skeleton
Installing Pod dependencies
Command failed: pod install
os-x-10:Desktop mfikes$ pod --version
0.38.2
os-x-10:Desktop mfikes$ sudo pod --version
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:417:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
Usage:
$ pod COMMAND
CocoaPods, the Cocoa library package manager.
Commands:
+ cache Manipulate the CocoaPods cache
+ init Generate a Podfile for the current directory.
+ install Install project dependencies to Podfile.lock versions
+ ipc Inter-process communication
+ lib Develop pods
+ list List pods
+ outdated Show outdated project dependencies
+ repo Manage spec-repositories
+ search Searches for pods
+ setup Setup the CocoaPods environment
+ spec Manage pod specs
+ update Update outdated project dependencies and create new Podfile.lock
Options:
--silent Show nothing
--version Show the version of the tool
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:45:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/bin/pod:44:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
os-x-10:Desktop mfikes$
I'm reinstalling fresh on my Yosemite VM (meaning I went back to the snapshot created after the OS was set up, prior to Xcode and everything else), to see if I can catch this permissions problem.
I suspect that this is just something I need to do properly and is actually unrelated to Natal.
Typically npm users will change the owner of /usr/local/bin
to their user so npm-based binaries work without sudo. See this for more details: https://docs.npmjs.com/getting-started/fixing-npm-permissions
It seems that pod doesn't work when run as root. If a user happens to run Natal as root, I could have it run the pod install step as another user, but I'm not sure how I'd get the right user id.
Ahh, cool. I may have done that on my main machine and had forgotten all about it when it came to my VM. Will close this one, given that. :)