首页 / 浏览问题 / 云GIS / 问题详情
使用npm安装leaflet,提示目录找不到
58EXP 2018年09月11日
使用npm install @supermap/iclient-leaflet,会出现各种警告和错误。主要错误是在node_modules下找不到相应的目录,agentkeepalive、d3-array、d3-geo、d3-voronoi、earcut等等。。。这个问题要怎么解决?

提示如下:

npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\d3-voronoi
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\density-clustering
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\earcut
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\elasticsearch\node_modules\agentkeepalive
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\elasticsearch\node_modules\lodash
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\fetch-ie8
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\fetch-jsonp
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\geojson-equality\node_modules\deep-equal
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\geojson-equality
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\get-closest
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\lineclip
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\lodash.get
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\lodash.isempty
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\lodash.topairs
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\lodash.trimend
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\mgrs
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\pbf\node_modules\ieee754
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\point-in-polygon
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\promise-polyfill
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\rbush
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\geojson-rbush
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\resolve-protobuf-schema
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\concaveman\node_modules\robust-orientation
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\monotone-convex-hull-2d
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\skmeans
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\elasticsearch\node_modules\chalk
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\elasticsearch
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\tinyqueue
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\topojson-client\node_modules\commander
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\concaveman
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\topojson-client
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\topojson-server
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\turf-jsts
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\zrender
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\echarts
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\jsonsql
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\leaflet
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\pbf
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\proj4
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\rbush\node_modules\quickselect
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\monotone-convex-hull-2d\node_modules\robust-orientation
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\resolve-protobuf-schema\node_modules\protocol-buffers-schema
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\elasticsearch\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\geojson-equality\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\pbf\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\concaveman\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\topojson-client\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\rbush\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\monotone-convex-hull-2d\node_modules
npm WARN checkPermissions Missing write access to D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\resolve-protobuf-schema\node_modules
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\d3-voronoi
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'D:\0-项目文件\demo\leaflet\webForLeaflet\node_modules\d3-voronoi'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\nodeJs\node_cache\_logs\2018-09-11T08_37_11_793Z-debug.log

2 个回答

已解决。在使用vue init webpack 模板的时候,起初的两个tests都设置为no即可正常安装。

 Setup unit tests ? No
 Setup e2e tests? No
58EXP 2018年09月12日
5,668EXP 2018年09月11日
就是按照这个通过npm的方式引入的,引入的过程中报了上面问题。

还有有没有基于vue的SuperMap iClient for leaflet 的包呢?

已解决,在是用vue init webpack 模板的时候,起初的两个tests都设置为no即可正常安装。

 Setup unit tests ? No
 Setup e2e tests? No
...