看到大家说 npm ci
比 npm install
运行速度快,但是需要目录下有 package-lock.json
但是执行了 npm ci
却报错如下:
> [email protected] install D:\a_git_working\smartcampus_pc\office\node_modules\fsevents
> node-gyp rebuild
D:\a_git_working\smartcampus_pc\office\node_modules\fsevents>if not defined npm_config_node_gyp (node "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
sys.exit(gyp.script_main())
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 554, in script_main
return main(sys.argv[1:])
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 547, in main
return gyp_main(args)
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 532, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 2024, in GenerateOutput
sln_projects, project_objects, flat=msvs_version.FlatSolution())
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1781, in _GatherSolutionFolders
return _DictsToFolders('', root, flat)
File "D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1734, in _DictsToFolders
for folder, contents in bucket.items():
AttributeError: 'MSVSProject' object has no attribute 'items'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (D:\Diesel.Program\nvm\v10.17.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:344:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "D:\\Diesel.Program\\nodejs\\node.exe" "D:\\Diesel.Program\\nvm\\v10.17.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\a_git_working\smartcampus_pc\office\node_modules\fsevents
gyp ERR! node -v v10.17.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
1
jinliming2 2019-12-30 17:00:25 +08:00 via iPhone
你这个是触发了 fsevents 的重新编译安装,windows 下是需要安装 python 和 visual studio build tools 的,并且你依赖的这个 fsevents 版本有点太低,新版环境( node、python、vs build tools )不一定能编译通过……
|
2
bologer OP @jinliming2 那么在满足 win 下有 python 和 vabt 的情况下, 升级一下 fsevents 就可以了是吧?
|
3
lihongjie0209 2019-12-31 10:17:19 +08:00
直接用 yarn 吧, 和 npm 可以并存, 速度也快
|
4
bologer OP @lihongjie0209 主要是 10 几人团队在用,而且有些在外地,换的话成本太大
|
5
liuliangsir 2020-12-21 10:32:07 +08:00
遇到相同的问题,最后是如何解决的呢?
|