【发布时间】:2016-09-17 17:00:19
【问题描述】:
最近我切换到 Node v.6,它开始在运行正常构建 grunt/gulp/webpack 时产生越来越多的问题
例如:
$ gulp
[14:02:20] Local gulp not found in ~/_Other/angular-2-ts/angular2-seed
[14:02:20] Try running: npm install gulp
在 /node_modules 文件夹中安装 gulp 和所有其他插件和模块(甚至通过 rm -rf node_modules 重新安装)。
这些错误中的大多数都有类似的行
(node:42) fs: re-evaluating native module sources is not supported.
If you are using the graceful-fs module,
please update it to a more recent version.
42 为任意数
就像我提交的那个问题一样 - 在 angular2-seed repo https://github.com/mgechev/angular2-seed/issues/902
我尝试做的是通过 n (https://www.npmjs.com/package/n) 降级到 Node v.5 - 它奏效了。然后删除所有node_modules文件夹,然后做
npm info graceful-fs -v
3.3.6
好的,让我们升级或删除并安装新的:
npm i graceful-fs@latest
npm i graceful-fs@4.1.4
sudo npm i graceful-fs@4.1.4 -g
所有结果
npm info graceful-fs -v
3.3.6
所以现在我被 graceful-fs 3.3.6 卡住了,甚至在某些模块依赖中更糟,比如
$ angular2-seed
$ npm install
//other lines..
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before
will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0
as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
这里的策略是什么:
- 手动修补所有包含graceful-fs
- 有一些全局开关可以使用特定的包版本吗?
- 重新安装所有东西?
【问题讨论】:
-
我在使用 Gulp 和我的一些模块时遇到了同样的问题。我通过升级模块以使用最新的优雅 fs 来修复我的模块,但我不确定是否有解决方案来修复尚未升级的其他模块。
-
看起来这不会在 Gulp 3.x 中修复,您必须升级到 Gulp 4.x github.com/gulpjs/gulp/issues/1571
标签: node.js npm node-modules npm-install