npm update 更新报错 enoent ENOENT
发布于 1 年前 作者 Jonealready 1617 次浏览 来自 问答
npm update
[email protected] /Users/zach
├── [email protected]
└── UNMET PEER DEPENDENCY vue@^2.1.6

npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/babel-generator/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/babel-template/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/babel-traverse/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/caching-transform/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/find-cache-dir/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/handlebars/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/istanbul-lib-instrument/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/istanbul-lib-report/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/istanbul-lib-source-maps/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/istanbul-reports/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/zach/node_modules/spawn-wrap/package.json'
npm WARN [email protected] requires a peer of vue@^2.1.6 but none was installed.
1 回复

首先检查package.json文件是否存在,如果存在是否之前把项目做过跨平台迁移,如果是删除旧package.json并复制package.json 内容到新的package.json 重新运行npm update

回到顶部