我是新手并且正在学习如何在WordPress上学习Udemy课程。我在Terminal非常缺乏经验,课程的一部分已经转移到学习JavaScript,他正在使用gulp watch
来查看更改自动更新。
尽我所能,我无法让Gulp安装在运行El Capitan的MBP上,我一直看到有关它被弃用的消息,并按照this link on Medium上的信息
问题是,作为初学者,我不知道这是什么意思。我已将目录更改为我应该在的文件夹结构的根目录,并且已按照指示复制了四个文件(gulpfile.js,package.json,settings.js和webpack.config.js)但不管我尝试的是什么我收到以下错误:
Dans-MBP:app danmichael$ npm install gulp
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.3: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN checkPermissions Missing write access to /Users/danmichael/Local Sites/fictional-university/app/node_modules/gulp
npm WARN checkPermissions Missing write access to /Users/danmichael/Local Sites/fictional-university/app/node_modules
npm WARN fictional-university-lwc@1.0.0 No repository field.
我在安装命令之前尝试使用'sudo'也无济于事。最近(今天)我现在也看到了'EACCES'错误,我不知道如何修复,据我所知,我设置为Adminstrator(仅限该Mac的用户):
npm ERR! path /Users/danmichael/Local Sites/fictional-university/app/node_modules/gulp
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/danmichael/Local Sites/fictional-university/app/node_modules/gulp'
npm ERR! { Error: EACCES: permission denied, access '/Users/danmichael/Local Sites/fictional-university/app/node_modules/gulp'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/Users/danmichael/Local Sites/fictional-university/app/node_modules/gulp\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/danmichael/Local Sites/fictional-university/app/node_modules/gulp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
如果我运行node -v
,我会得到v8.11.1
如果我运行gulp -v
,我将获得CLI版本3.9.1,本地版本3.9.1
但我仍然无法运行gulp watch
。