最近想研究glup
可是安裝上遇到問題,scss轉css都失敗,我看下面好像是npm的問題,有前輩能指點一下嗎
C:>npm install --global 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
C:\Users\User\AppData\Roaming\npm\gulp -> C:\Users\User\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
C:>
C:>
C:>gulp --version
[17:12:59] CLI version 3.9.1
C:>cd C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass
C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass>npm install gulp
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass\package.json'
npm WARN ironman-gulp-sass-0.1.sass No description
npm WARN ironman-gulp-sass-0.1.sass No repository field.
npm WARN ironman-gulp-sass-0.1.sass No README data
npm WARN ironman-gulp-sass-0.1.sass No license field.
npm audit fix
to fix them, or npm audit
for detailsC:\Users\User\Downloads\ironman-gulp-sass-0.1.sass>gulp --version
[17:14:08] CLI version 3.9.1
[17:14:08] Local version 3.9.1
C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass>
C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass>npm install gulp-sass --save-dev
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass\package.json'
npm WARN ironman-gulp-sass-0.1.sass No description
npm WARN ironman-gulp-sass-0.1.sass No repository field.
npm WARN ironman-gulp-sass-0.1.sass No README data
npm WARN ironman-gulp-sass-0.1.sass No license field.
npm audit fix
to fix them, or npm audit
for detailsC:\Users\User\Downloads\ironman-gulp-sass-0.1.sass>
感謝大大我重裝node就成功了
有問題的可以參考這篇
https://www.daimafans.com/question/d4153344689963008-p1-o1.html
如同weiclin大大提示:
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\User\Downloads\ironman-gulp-sass-0.1.sass\package.json'
這個訊息是警告你package.json檔案不存在。通常這個檔案需要跑npm init
來產生(手動也可以,如果你熟悉package.json的格式)。不過沒有package.json也只是無法管理你安裝的模組,並不是不能跑。所以...
更關鍵的是,你沒貼gulpfile.js,尤其是你轉sass的task,這樣怎麼知道你怎麼跑的?