2014-04-30 10 views
5

को पुनर्स्थापित करने के बाद काम नहीं कर रहा है मुझे अपने लैपटॉप पर मैक ओएस एक्स मैवरिक्स को पुनर्स्थापित करना पड़ा। अब एनपीएम काम नहीं करता है। हालांकि, लैपटॉप पर नोड अभी भी है और एनपीएम $ पाथ में है।npm मैक ओएस एक्स

christohersmbp3:~ christopherspears$ node 
> console.log('hello node'); 
hello node 
undefined 
> 
(^C again to quit) 
> 

इसे ठीक करने या मैं सिर्फ Node.js को पुनर्स्थापित करना चाहिए पर कोई भी विचार:

christohersmbp3:angular-phonecat christopherspears$ npm install 
-bash: npm: command not found 
christohersmbp3:angular-phonecat christopherspears$ node --version 
v0.10.26 
christohersmbp3:angular-phonecat christopherspears$ npm start 
-bash: npm: command not found 
christohersmbp3:angular-phonecat christopherspears$ echo $PATH 
/usr/local/share/python:/Users/christopherspears/.rbenv/bin:/Users/christopherspears/bin:/usr/local/heroku/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin 

मैं वास्तव में काफी आसानी से चल रहा है नोड प्राप्त करने में सक्षम था?

अद्यतन:

मैं स्थापना रद्द करें और Node.js पुनर्स्थापित करने के लिए कोशिश कर रहे हैं लेकिन कोई समस्या हुई थी:

christohersmbp3:npm christopherspears$ pwd 
/usr/local/lib/node_modules/npm 
christohersmbp3:npm christopherspears$ ll 
total 112 
-rw-r--r-- 1 24561    staff 5759 Feb 18 14:59 AUTHORS 
-rw-rw-r-- 1 24561    staff 380 Feb 18 14:59 CONTRIBUTING.md 
-rw-r--r-- 1 24561    staff 9862 Feb 18 14:59 LICENSE 
-rw-r--r-- 1 24561    staff 6178 Jan 28 19:21 Makefile 
-rw-r--r-- 1 24561    staff 7623 Feb 18 14:59 README.md 
drwxr-xr-x 7 christopherspears staff 238 Apr 6 15:54 bin/ 
-rwxr-xr-x 1 24561    staff 48 Jan 28 19:21 cli.js* 
-rwxr-xr-x 1 24561    staff 521 Jan 28 19:21 configure* 
drwxr-xr-x 6 christopherspears staff 204 Mar 7 22:32 doc/ 
drwxr-xr-x 9 christopherspears staff 306 Apr 6 15:54 html/ 
drwxr-xr-x 55 christopherspears staff 1870 Apr 6 15:54 lib/ 
-rw-rw-r-- 1 24561    staff 156 Jan 28 19:21 make.bat 
drwxr-xr-x 6 christopherspears staff 204 Mar 7 22:32 man/ 
drwxr-xr-x 51 christopherspears staff 1734 Mar 7 22:32 node_modules/ 
-rw-r--r-- 1 24561    staff 3449 Feb 18 14:59 package.json 
drwxr-xr-x 8 christopherspears staff 272 Apr 6 15:54 scripts/ 
drwxr-xr-x 9 24561    staff 306 Apr 6 15:54 test/ 
चाहिए

:

christohersmbp3:angular-phonecat christopherspears$ brew uninstall node 
Uninstalling /usr/local/Cellar/node/0.10.26... 
christohersmbp3:angular-phonecat christopherspears$ brew install node 
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/node-0.10.26.mavericks.bottle.tar.gz 
######################################################################## 100.0% 
==> Pouring node-0.10.26.mavericks.bottle.tar.gz 
==> Caveats 
Bash completion has been installed to: 
    /usr/local/etc/bash_completion.d 
Error: The `brew link` step did not complete successfully 
The formula built, but is not symlinked into /usr/local 
You can try again using: 
    brew link node 

Possible conflicting files are: 
/usr/local/bin/node 
/usr/local/include/node/zlib.h 
/usr/local/include/node/zconf.h 
/usr/local/include/node/v8stdint.h 
/usr/local/include/node/v8.h 
/usr/local/include/node/v8-testing.h 
/usr/local/include/node/v8-profiler.h 
/usr/local/include/node/v8-preparser.h 
/usr/local/include/node/v8-debug.h 
/usr/local/include/node/uv.h 
/usr/local/include/node/uv-private/uv-win.h 
/usr/local/include/node/uv-private/uv-unix.h 
/usr/local/include/node/uv-private/uv-sunos.h 
/usr/local/include/node/uv-private/uv-linux.h 
/usr/local/include/node/uv-private/uv-darwin.h 
/usr/local/include/node/uv-private/uv-bsd.h 
/usr/local/include/node/uv-private/tree.h 
/usr/local/include/node/uv-private/stdint-msvc2008.h 
/usr/local/include/node/uv-private/ngx-queue.h 
/usr/local/include/node/openssl/opensslconf.h 
/usr/local/include/node/node_version.h 
/usr/local/include/node/node_object_wrap.h 
/usr/local/include/node/node_internals.h 
/usr/local/include/node/node_buffer.h 
/usr/local/include/node/node.h 
/usr/local/include/node/nameser.h 
/usr/local/include/node/config.gypi 
/usr/local/include/node/common.gypi 
/usr/local/include/node/ares_version.h 
/usr/local/include/node/ares.h 
/usr/local/share/man/man1/node.1 
/usr/local/lib/dtrace/node.d 
Warning: The post-install step did not complete successfully 
You can try again using `brew postinstall node` 
==> Summary 
    /usr/local/Cellar/node/0.10.26: 1523 files, 18M 
christohersmbp3:angular-phonecat christopherspears$ brew link node 
Linking /usr/local/Cellar/node/0.10.26... 
Error: Could not symlink bin/node 
Target /usr/local/bin/node 
already exists. You may want to remove it: 
    rm /usr/local/bin/node 

To force the link and overwrite all conflicting files: 
    brew link --overwrite node 

To list all files that would be deleted: 
    brew link --overwrite --dry-run node 
christohersmbp3:angular-phonecat christopherspears$ brew link --overwrite node 
Linking /usr/local/Cellar/node/0.10.26... 135 symlinks created 
christohersmbp3:angular-phonecat christopherspears$ brew postinstall node 
Error: Permission denied - /usr/local/lib/node_modules/npm/AUTHORS 

मैं फ़ोल्डर में एक दृष्टि डाली मैं मालिक को 24561 से क्रिस्टोफरस्पर्स में बदलता हूं?

अद्यतन:

मैं लेखक के स्वामी को बदल किया christopherspears फ़ाइल।

christohersmbp3:angular-phonecat christopherspears$ brew postinstall node 
Error: Permission denied - /usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp 

एक ही मुद्दे की तरह लग रहा:

christohersmbp3:node-gyp-bin christopherspears$ ll 
total 16 
-rwxr-xr-x 1 24561 staff 89 Jan 28 19:21 node-gyp* 
-rwxr-xr-x 1 24561 staff 61 Jan 28 19:21 node-gyp.cmd* 

मैं 24,561 के स्वामित्व वाली फ़ाइलों के सभी के लिए यह करने के लिए जा रहा हूँ अब मैं इस त्रुटि मिल रहा है? मुझे आशा नहीं है।

अद्यतन:

उह। बहुत लंगड़ा। ऐसा लगता है कि मुझे मालिक को 24561 से हर जगह मेरे उपयोगकर्ता नाम में बदलने के लिए कहा जा रहा है। मालिक पहले स्थान पर 24561 क्यों सेट किया गया था?

उत्तर

3

मालिक को 24561 से मेरे उपयोगकर्ता नाम में बदलने के बाद, मुझे काम करने के लिए एनपीएम मिला।

+0

क्या मालिक के मालिक को बदल रहा है? विशेष रूप से कौन सी निर्देशिका? –

+0

मुझे लगता है कि मैंने बस प्रत्येक निर्देशिका के मालिक को बदल दिया है जहां मालिक 24561 पर सेट किया गया था। –

+5

@ विन्सिल बिशप, आमतौर पर, आप स्थानों पर यह सलाह देखते हैं: '$ sudo chown -R YourUserName/usr/local/lib/node_modules /' – 7stud