Google 聚合物入门套件 npm 安装时发出警告
Google polymer starter kit WARN when npm install
当我从 github here and on the 4th step of these instructions here 下载 "Intermediate - Advanced users" 版本的聚合物入门套件时,我总是收到这些警告:
$ sudo npm install
npm WARN deprecated gulp-minify-css@1.2.4: Please use gulp-clean-css
npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN engine launchpad@0.5.1: wanted: {"node":"^0.12"} (current: {"node":"4.4.2","npm":"2.15.0"})
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN optional dep failed, continuing fsevents@1.0.11
npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
无论我使用什么 OS:都尝试了 Ubuntu 和 Windows (git bash)。
我在全局安装了 npm、bower、gulp,但总是有那些警告。
我认为这可能是依赖关系问题,或者是因为某些聚合物入门工具包文件中的某些代码,但我不是专业开发人员,所以我找不到导致问题的原因
当我部署项目时,一切似乎都正常,但我是网络开发新手,不确定是否必须对这些 WARN 视而不见
这些警告无需担心。这些来自在 package.json 文件中设置为依赖项的 npm 包。当您 运行 npm install
时,它将安装 package.json 中设置的所有软件包。每个包都有自己的 package.json,也有一些依赖项。每个包安装他们自己需要的那个包的版本,有时他们使用这些包的旧版本。摆脱这些警告的唯一方法是让包创建者更新他们的包。
您可以自己更新的唯一软件包是 gulp-minify-css
。您可以卸载该软件包 npm remove gulp-minify-css --save-dev
并安装较新的未弃用版本 gulp-clean-css
。 npm install gulp-clean-css --save-dev
。如果这样做,您需要为项目更新 gulpfile.js
以使用新包。
在 gulpfile.js
:
中找到初学者工具包的 styleTask
var styleTask = function(stylesPath, srcs) {
return gulp.src(srcs.map(function(src) {
return path.join('app', stylesPath, src);
}))
.pipe($.changed(stylesPath, {extension: '.css'}))
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe(gulp.dest('.tmp/' + stylesPath))
.pipe($.minifyCss())
.pipe(gulp.dest(dist(stylesPath)))
.pipe($.size({title: stylesPath}));
};
并将 .pipe($.minifyCss())
行更改为 .pipe($.cleanCss({compatibility: 'ie10'}))
现在您已经成功地更新了初学者工具包以使用更新的非弃用包。
npm 包管理器中的许多包都有一些已弃用的包或在安装时引起其他警告,但大多数时候无需担心。
在这种情况下无需担心这些警告。他们不应该引起你提到的问题。我验证了您提到的 PSK 指南(该页面在 OSX El Capitan 上的 Chrome 版本 49.0.2623.112 中完全显示并且正常运行)。
npm
当正在安装的依赖项已被依赖项的包 deprecated owner/maintainer 通常支持另一个具有重大改进的 package/version 时显示弃用警告。程序包可以 deprecated/undeprecated 随意使用,也可以在您的应用部署很久之后使用。
例如,在一月份,您发布了一个依赖 gulp-minify-css@1.2.4
的应用。 gulp-minify-css
的所有者不再有时间维护该软件包,因此他在 3 月份决定弃用它以支持积极维护的 gulp-clean-css
。现在,npm install
您的应用(也会安装 gulp-minify-css
)的用户会看到此弃用警告,但您的应用仍能正常运行。弃用不会使您的应用失效或导致错误。
虽然通常人们可能会尝试升级依赖项以删除警告,但由于最近在 pull request:
中发现的包不兼容,因此不建议 PSK 这样做
So I just took this for a spin and I ran into some issues :( although
the current gulp plugins are deprecated they are working for the
community! This PR represents a "high risk" change, that we have found
to be breaking in several odd ways. For that reason I am going to
close this PR for now. That said let's revisit this PR in a few months
and see if things have stabilized more.
当我从 github here and on the 4th step of these instructions here 下载 "Intermediate - Advanced users" 版本的聚合物入门套件时,我总是收到这些警告:
$ sudo npm install
npm WARN deprecated gulp-minify-css@1.2.4: Please use gulp-clean-css
npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN engine launchpad@0.5.1: wanted: {"node":"^0.12"} (current: {"node":"4.4.2","npm":"2.15.0"})
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN optional dep failed, continuing fsevents@1.0.11
npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
无论我使用什么 OS:都尝试了 Ubuntu 和 Windows (git bash)。
我在全局安装了 npm、bower、gulp,但总是有那些警告。
我认为这可能是依赖关系问题,或者是因为某些聚合物入门工具包文件中的某些代码,但我不是专业开发人员,所以我找不到导致问题的原因
当我部署项目时,一切似乎都正常,但我是网络开发新手,不确定是否必须对这些 WARN 视而不见
这些警告无需担心。这些来自在 package.json 文件中设置为依赖项的 npm 包。当您 运行 npm install
时,它将安装 package.json 中设置的所有软件包。每个包都有自己的 package.json,也有一些依赖项。每个包安装他们自己需要的那个包的版本,有时他们使用这些包的旧版本。摆脱这些警告的唯一方法是让包创建者更新他们的包。
您可以自己更新的唯一软件包是 gulp-minify-css
。您可以卸载该软件包 npm remove gulp-minify-css --save-dev
并安装较新的未弃用版本 gulp-clean-css
。 npm install gulp-clean-css --save-dev
。如果这样做,您需要为项目更新 gulpfile.js
以使用新包。
在 gulpfile.js
:
var styleTask = function(stylesPath, srcs) {
return gulp.src(srcs.map(function(src) {
return path.join('app', stylesPath, src);
}))
.pipe($.changed(stylesPath, {extension: '.css'}))
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe(gulp.dest('.tmp/' + stylesPath))
.pipe($.minifyCss())
.pipe(gulp.dest(dist(stylesPath)))
.pipe($.size({title: stylesPath}));
};
并将 .pipe($.minifyCss())
行更改为 .pipe($.cleanCss({compatibility: 'ie10'}))
现在您已经成功地更新了初学者工具包以使用更新的非弃用包。
npm 包管理器中的许多包都有一些已弃用的包或在安装时引起其他警告,但大多数时候无需担心。
在这种情况下无需担心这些警告。他们不应该引起你提到的问题。我验证了您提到的 PSK 指南(该页面在 OSX El Capitan 上的 Chrome 版本 49.0.2623.112 中完全显示并且正常运行)。
npm
当正在安装的依赖项已被依赖项的包 deprecated owner/maintainer 通常支持另一个具有重大改进的 package/version 时显示弃用警告。程序包可以 deprecated/undeprecated 随意使用,也可以在您的应用部署很久之后使用。
例如,在一月份,您发布了一个依赖 gulp-minify-css@1.2.4
的应用。 gulp-minify-css
的所有者不再有时间维护该软件包,因此他在 3 月份决定弃用它以支持积极维护的 gulp-clean-css
。现在,npm install
您的应用(也会安装 gulp-minify-css
)的用户会看到此弃用警告,但您的应用仍能正常运行。弃用不会使您的应用失效或导致错误。
虽然通常人们可能会尝试升级依赖项以删除警告,但由于最近在 pull request:
中发现的包不兼容,因此不建议 PSK 这样做So I just took this for a spin and I ran into some issues :( although the current gulp plugins are deprecated they are working for the community! This PR represents a "high risk" change, that we have found to be breaking in several odd ways. For that reason I am going to close this PR for now. That said let's revisit this PR in a few months and see if things have stabilized more.