【发布时间】:2018-03-16 01:25:30
【问题描述】:
我尝试重新安装 node.js 几次,并尝试使用不同的版本,但我仍然得到相同的错误。我还以管理员身份运行 CMD。好像没有找到json-schema,我什至尝试手动安装它,但出现同样的错误。这是我收到的错误消息:
C:\> npm install -g @angular/cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\@angular\cli\node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\admin\AppData\Roaming\npm\node_modules\.staging\fsevents-edb66af1\node_modules\asn1' -> 'C:\Users\admin\AppData\Roaming\npm\node_modules\.staging\asn1-98b68b78'
npm ERR! path C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\json-schema
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\json-schema' -> 'C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@ngtools\.json-schema.DELETE'
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! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-03-15T07_42_19_026Z-debug.log
【问题讨论】:
-
试试
npm cache clean --force -
可能会检查并更新你的 npm