我正在按照建议升级一个 Angular 项目here 。我完成了更新http客户端和所有相应调用的第一步。我还确保节点版本大于 8。
现在当我运行下一个命令时:
NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@6 update @angular/cli@6
,我收到以下错误。
./Release/.deps/Release/obj.target/fse/fsevents.o.d.raw Stats {
dev: 16777221,
mode: 33188,
nlink: 1,
uid: 501,
gid: 20,
rdev: 0,
blksize: 4096,
ino: 25225592,
size: 1790,
blocks: 8,
atimeMs: 1650347794000,
mtimeMs: 1650347794000,
ctimeMs: 1650347794392.3928,
birthtimeMs: 1650347794000,
atime: 2022-04-19T05:56:34.000Z,
mtime: 2022-04-19T05:56:34.000Z,
ctime: 2022-04-19T05:56:34.392Z,
birthtime: 2022-04-19T05:56:34.000Z
}
Your global Angular CLI version (6.2.9) is greater than your local
version (1.7.4). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Error: Unexpected end of JSON input
Unexpected end of JSON input
但是,如果我通过运行命令 ngserve
来运行项目,则项目会成功运行。如果有人能帮助我确定这个错误是什么,我将不胜感激。
最佳答案
尝试以下步骤,希望它对您有用。
npm install --save-dev @angular/cli@6
关于 Angular 项目更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71920289/