0
我試圖在我的mac上運行gulp。我真的很陌生,對我這麼裸露的東西。我走進終端,進入我的大文件夾。當我鍵入試圖在mac上運行gulp,但它不工作
gulp
我得到「-bash:gulp:command not found」。在我的gulp文件夾中,我確實有一個gulpfile.js,但又一次。沒有。我從哪裏出發?謝謝大家!
這裏是我得到的錯誤,當我NPM安裝-g
MacBook-Pro-2:gulp-dev damien$ npm install -g gulp
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! path ../lib/node_modules/gulp/bin/gulp.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/gulp/bin/gulp.js',
npm ERR! dest: '/usr/local/bin/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/damien/.npm/_logs/2017-04-11T20_42_46_317Z-debug.log
MacBook-Pro-2:gulp-dev damien$ npm install -g gulp
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v7.8.0
npm ERR! npm v4.2.0
npm ERR! path ../lib/node_modules/gulp/bin/gulp.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/gulp/bin/gulp.js' -> '/usr/local/bin/gulp'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/gulp/bin/gulp.js',
npm ERR! dest: '/usr/local/bin/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/damien/.npm/_logs/2017-04-11T20_43_48_551Z-debug.log
我有一個的package.json文件。我從來沒有安裝過gulp,我不認爲,但是我只是運行了你的命令npm install -g gulp,並且我得到了一堆錯誤。我將編輯我的問題以顯示錯誤 – Damien
另外,我嘗試在所有訪問權限設置父文件夾的權限,但這不起作用 – Damien
是的,您似乎沒有權限這麼做。這意味着你必須使用'sudo'和'npm'命令,但這通常是不明智的。 多的人寫了一篇關於一個安全的方式這樣做: - https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md - https://johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/ - http://www.competa.com/blog/how-to-run-npm-without-sudo/ – Lodybo