npm update 更新报错 enoent ENOENT
npm update
npm@3.10.8 /Users/zach
├── element-ui@1.2.9
└── 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 element-ui@1.2.9 requires a peer of vue@^2.1.6 but none was installed.
1 回复
首先检查package.json文件是否存在,如果存在是否之前把项目做过跨平台迁移,如果是删除旧package.json并复制package.json 内容到新的package.json 重新运行npm update