2017-07-16 61 views
0

我一直有一个问题,我一直试图找出一个小时左右,我似乎无法弄清楚。NPM抛出缺少的依赖关系,但它存在吗?

当我包括我的app.js谷歌地图文件然后重新加载,我从下面的NPM得到一个错误:

ERROR Failed to compile with 14 errors                                              
5:05:10 PM 
This dependency was not found: 

* fs in ./node_modules/request/lib/har.js 

To install it, you can run: npm install --save fs 


This relative module was not found: 

* ./config/constants in ./node_modules/googlemaps/lib/index.js, ./node_modules/googlemaps/lib/placeSearchText.js and 11 others Asset  Size 

但是当我运行NPM安装--save fs的运行和完成,但我仍然得到相同的错误。

任何帮助,将不胜感激

NPM版本:5.3.0

谷歌地图:最新

节点JS:6.11.1

+0

节点标准不是'fs'的一部分吗?你使用的是什么版本的NPM和节点?根据NPM,'fs'不再是一个包:https://www.npmjs.com/package/fs – lilezek

+0

这很奇怪。我想知道为什么谷歌地图需要它作为依赖? – Dazeh

+0

编辑您的问题添加更多信息:NPM的版本,Node的版本,谷歌地图的版本... – lilezek

回答

0

对不起,我不能添加评论,但尝试卸载像这样的包:
npm uninstall <package name>然后再次重新安装它:npm install <package name>

有时它有效。

+0

不幸的是它没有工作:( – Dazeh

+0

太糟糕了,我希望你找到答案。@Dazeh –

+0

1:'rm -rf node_modules' 2.'npm cache clear' 3.'npm install' good lucks!sometime works – Qiu