2016-03-09 20 views
12

tôi cố gắng cài đặt ngụm trong mac như thế này:-bash: ngụm: command not found trong Mac

Is-iMac:~ itop$ npm root 
/Users/itop/node_modules 
Is-iMac:~ itop$ npm config set prefix /usr/local 
Is-iMac:~ itop$ npm root -g 
/usr/local/lib/node_modules 
Is-iMac:~ itop$ sudo npm install -g gulp 

Sau khi cài đặt tôi thấy lỗi này Trong terminal:

npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to [email protected]^4.0.0 as soon as possible. 
npm WARN deprecated [email protected]: [email protected]<3.0.0 is no longer maintained. Upgrade to [email protected]^4.0.0. 
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to [email protected]^4.0.0 as soon as possible. 
npm ERR! Darwin 15.3.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp" 
npm ERR! node v5.6.0 
npm ERR! npm v3.8.0 
npm ERR! path /usr/local/bin/gulp 
npm ERR! code EEXIST 

npm ERR! Refusing to delete /usr/local/bin/gulp: ../lib/node_modules/gulp-cli/bin/gulp.js symlink target is not controlled by npm /usr/local 
npm ERR! File exists: /usr/local/bin/gulp 
npm ERR! Move it away, and try again. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/it/npm-debug.log 

Bây giờ khi tôi gõ gulp để bắt đầu/chạy trong terminal tôi thấy lỗi này:

-bash: gulp: command not found 

EDIT: tôi cố gắng với nhận xét này By archie-voyageur:

npm install --global gulp-cli 

Và Xem lỗi này:

/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp-cli/bin/gulp.js 
npm ERR! Darwin 15.3.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "gulp-cli" 
npm ERR! node v5.6.0 
npm ERR! npm v3.8.0 
npm ERR! path /usr/local/share/man/man1/gulp.1 
npm ERR! code EEXIST 

npm ERR! Refusing to delete /usr/local/share/man/man1/gulp.1: ../../../lib/node_modules/gulp/gulp.1 symlink target is not controlled by npm /usr/local 
npm ERR! File exists: /usr/local/share/man/man1/gulp.1 
npm ERR! Move it away, and try again. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/itop/npm-debug.log 

Làm thế nào để sửa lỗi này?

+0

@ArchieVoyageur: cảm ơn tôi đã thử Điều này vui lòng xem Chỉnh sửa của tôi. –

+0

Tôi không chắc liệu mình có hiểu những gì không rõ ràng về 'Tệp tồn tại, Di chuyển nó đi và thử lại.' .... – Carpetsmoker

Trả lời

1

Tôi nghĩ bạn đã cài đặt gulp trong hệ thống của mình hoặc ít nhất bạn có một số tệp liên quan đến gulp. Chỉ cần thực hiện npm uninstall --global gulp gulp-cli và sau đó thử cài đặt lại với npm install --global gulp-cli. Nếu điều này không hiệu quả, tôi không biết điều gì đang xảy ra trên hệ thống của bạn.

+0

Tôi thử và thấy lỗi tương tự. –

+0

Điều duy nhất đến với đầu của tôi mà bạn có thể làm là unistall Node từ hệ thống của bạn và cài đặt nó từ đầu một lần nữa. Nhưng tôi không có nhiều hy vọng về điều đó bởi vì tôi không biết điều gì đang cản trở vấn đề của bạn. – franmartosr

4

đi để

cd /usr/local/bin 
ls -las 

if gulp is present delete that directory. (sudo rm -rf gulp) reinstall gulp-cli

================================ ===================================

nếu nút không gỡ cài đặt hoạt động, npm hoàn toàn và thử lại

follow this link for step by step guide

node and npm uninstall step by step

43

Chỉ cần đi qua vấn đề này bản thân mình và cố gắng giải quyết vấn đề này với:

$ npm uninstall --global gulp gulp-cli 
$ rm /usr/local/share/man/man1/gulp.1 
$ npm install --global gulp-cli 
+2

Điều này giải quyết được vấn đề lâu dài của tôi, nên ở IMO hàng đầu! – colinmcp

+1

Làm việc cho tôi tháng 11 năm 2017 - OSX Sierra. – richtelford

+0

@binz Cảm ơn người đàn ông! – user1242321

0

Đối với tôi nó chỉ làm việc khi tôi cài đặt gulp sử dụng npm thay vì yarn. Rất lạ ..