Web scraping with CasperJS returns strange error that isn't documented

做~自己de王妃 提交于 2019-12-05 07:14:28

Okay guys I have an answer for you - the 'fs' is a module bundled with node, so it doesn't have to be installed through npm. The package you downloaded is this: https://www.npmjs.com/package/fs and all it contains is...

console.log("I'm `fs` modules");

When you did:

npm uninstall fs

npm install -g fs

The node used its local package - that it shipped with - and ignored the global one entirely. Mystery solved. ;)

user3663707

I had the same problem. My OS is window 7 but I don't think that OS is the problem.

This is what I did and it worked

  1. npm uninstall fs

  2. npm install -g fs

I don't know why this happened but it's fixed now.

This is not an error, it's a console.log message. This module may exist for universal JS purposes (fs doesn't apply to browser so you could remap an import in browser environment to this no-op package with browserify / webpack and not have your code crash). If that is the case, the message should say a bit clearer.

It may also have been published as a stop word for the fs package since it could be a potential exploit if someone were to publish a package with ill intent praying on users accidentally installing and running it instead of the built-in fs module.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!