cabloy用npm install报错--2023-07-14
操作系统:win11家庭版 nodeJS: v18.16.1 npm: 9.5.1 源码下载时间:2023-07-14 09:20 源码下载方式:git clone --depth=1 https://github.com/zhennann/cabloy.git 使用npm install报错如下:
D:\cabloy-lerna\cabloy>npm install
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.
npm ERR! code 1
npm ERR! path D:\cabloy-lerna\cabloy\node_modules\nx
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./bin/post-install
npm ERR! node:internal/modules/cjs/loader:1080
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module './lib/stringify'
npm ERR! Require stack:
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\braces\index.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\micromatch\index.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\node_modules\fast-glob\out\utils\pattern.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\node_modules\fast-glob\out\utils\index.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\node_modules\fast-glob\out\managers\tasks.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\node_modules\fast-glob\out\index.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\src\utils\nx-plugin.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\src\project-graph\build-nodes\workspace-projects.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\src\project-graph\build-nodes\index.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\src\project-graph\build-project-graph.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\src\project-graph\project-graph.js
npm ERR! - D:\cabloy-lerna\cabloy\node_modules\nx\bin\post-install.js
npm ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
npm ERR! at Module._load (node:internal/modules/cjs/loader:922:27)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1143:19)
npm ERR! at require (node:internal/modules/cjs/helpers:110:18)
npm ERR! at Object.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\lzf1201_128634653559\AppData\Local\npm-cache_logs\2023-07-14T01_31_57_441Z-debug-0.log
应该是braces的问题
- 确认一下node_modules/braces目录下面是否存在文件./lib/stringify
- 确认一下braces的版本号
- 我刚重新试了一遍,npm install是正常的,估计是网络原因导致下载的包不完整,建议加上淘宝镜像:npm install --registry=https://registry.npmmirror.com
- CabloyJS有两种安装模式:项目模式,源码模式。建议你优先尝试项目模式,然后是源码模式