为什么npm列表会在纱线添加后显示缺失和无关的错误?

时间:2017-01-15 20:59:32

标签: npm yarnpkg

我在项目中从npm切换到纱线,然后通过yarn add添加模块开始。

然而,之后我做了一个npm列表,现在它显示了大量错误:无关和遗漏错误。

我错过了什么 - 或者我应该忽略这些npm错误。我可以使用什么命令来确保我的依赖项没有错误/缺失?

 npm ERR! peer dep missing: react-dom@0.14.x || 15.* || ^15.0.0, required by react-apollo@0.8.1
    npm ERR! invalid: react-native@0.37.0 /Users/user/Projects/foo-app/node_modules/react-native
    npm ERR! extraneous: absolute-path@0.0.0 /Users/user/Projects/foo-app/node_modules/absolute-path
    npm ERR! extraneous: art@0.10.1 /Users/user/Projects/foo-app/node_modules/art
    npm ERR! extraneous: babel-plugin-external-helpers@6.18.0 /Users/user/Projects/foo-app/node_modules/babel-plugin-external-helpers
    npm ERR! extraneous: babel-polyfill@6.20.0 /Users/user/Projects/foo-app/node_modules/babel-polyfill
    npm ERR! extraneous: babel-preset-es2015-node@6.1.1 /Users/user/Projects/foo-app/node_modules/babel-preset-es2015-node
    npm ERR! extraneous: babel-preset-fbjs@2.1.0 /Users/user/Projects/foo-app/node_modules/babel-preset-fbjs
    npm ERR! extraneous: connect@2.30.2 /Users/user/Projects/foo-app/node_modules/connect
    npm ERR! extraneous: denodeify@1.2.1 /Users/user/Projects/foo-app/node_modules/denodeify
    npm ERR! extraneous: event-target-shim@1.1.1 /Users/user/Projects/foo-app/node_modules/event-target-shim
    npm ERR! extraneous: fbjs-scripts@0.7.1 /Users/user/Projects/foo-app/node_modules/fbjs-scripts
    npm ERR! extraneous: fs-extra@0.26.7 /Users/user/Projects/foo-app/node_modules/fs-extra
    npm ERR! extraneous: image-size@0.3.5 /Users/user/Projects/foo-app/node_modules/image-size
    npm ERR! extraneous: immutable@3.7.6 /Users/user/Projects/foo-app/node_modules/immutable
    npm ERR! extraneous: inquirer@0.12.0 /Users/user/Projects/foo-app/node_modules/inquirer
    npm ERR! extraneous: jest-haste-map@15.0.1 /Users/user/Projects/foo-app/node_modules/jest-haste-map
    npm ERR! extraneous: joi@6.10.1 /Users/user/Projects/foo-app/node_modules/joi
    npm ERR! extraneous: json5@0.4.0 /Users/user/Projects/foo-app/node_modules/json5
    npm ERR! extraneous: jstransform@11.0.3 /Users/user/Projects/foo-app/node_modules/jstransform
    npm ERR! extraneous: lodash@3.10.1 /Users/user/Projects/foo-app/node_modules/lodash
    npm ERR! extraneous: mime@1.3.4 /Users/user/Projects/foo-app/node_modules/mime
    npm ERR! extraneous: module-deps@3.9.1 /Users/user/Projects/foo-app/node_modules/module-deps
    npm ERR! extraneous: npmlog@2.0.4 /Users/user/Projects/foo-app/node_modules/npmlog
    npm ERR! extraneous: opn@3.0.3 /Users/user/Projects/foo-app/node_modules/opn
    npm ERR! extraneous: plist@1.2.0 /Users/user/Projects/foo-app/node_modules/plist
    npm ERR! extraneous: progress@1.1.8 /Users/user/Projects/foo-app/node_modules/progress
    npm ERR! extraneous: rebound@0.0.13 /Users/user/Projects/foo-app/node_modules/rebound
    npm ERR! extraneous: regenerator-runtime@0.9.6 /Users/user/Projects/foo-app/node_modules/regenerator-runtime
    npm ERR! extraneous: stacktrace-parser@0.1.4 /Users/user/Projects/foo-app/node_modules/stacktrace-parser
    npm ERR! extraneous: temp@0.8.3 /Users/user/Projects/foo-app/node_modules/temp
    npm ERR! extraneous: whatwg-fetch@1.1.1 /Users/user/Projects/foo-app/node_modules/whatwg-fetch
    npm ERR! extraneous: ws@1.1.1 /Users/user/Projects/foo-app/node_modules/ws
    npm ERR! extraneous: xcode@0.8.9 /Users/user/Projects/foo-app/node_modules/xcode
    npm ERR! extraneous: xmldoc@0.4.0 /Users/user/Projects/foo-app/node_modules/xmldoc
    npm ERR! extraneous: yargs@3.32.0 /Users/user/Projects/foo-app/node_modules/yargs
    npm ERR! extraneous: yeoman-environment@1.5.3 /Users/user/Projects/foo-app/node_modules/yeoman-environment
    npm ERR! extraneous: yeoman-generator@0.21.2 /Users/user/Projects/foo-app/node_modules/yeoman-generator
    npm ERR! extraneous: react-native-lightbox@0.6.0 /Users/user/Projects/foo-app/node_modules/react-native-lightbox
    npm ERR! extraneous: react-native-maps@0.11.0 /Users/user/Projects/foo-app/node_modules/react-native-maps
    npm ERR! extraneous: react-native-svg@4.3.0 /Users/user/Projects/foo-app/node_modules/react-native-svg
    npm ERR! extraneous: react-native-transformable-image@0.0.18 /Users/user/Projects/foo-app/node_modules/react-native-transformable-image
    npm ERR! extraneous: react-native-view-transformer@0.0.28 /Users/user/Projects/foo-app/node_modules/react-native-view-transformer
    npm ERR! missing: react-native-lightbox@git+https://github.com/shoutem/react-native-lightbox.git#master, required by @shoutem/ui@0.10.5
    npm ERR! missing: react-native-transformable-image@github:ldn0x7dc/react-native-transformable-image#master, required by @shoutem/ui@0.10.5
    npm ERR! missing: react-native-view-transformer@github:ldn0x7dc/react-native-view-transformer#master, required by @shoutem/ui@0.10.5
    npm ERR! missing: react-native-maps@git+https://github.com/exponent/react-native-maps.git#12853f0, required by exponent@12.0.5
    npm ERR! missing: react-native-svg@git+https://github.com/exponent/react-native-svg.git#51ff90cc, required by exponent@12.0.5
    npm ERR! missing: jest-resolve@git+https://github.com/exponentjs/jest-resolve.git, required by jest-exponent@0.1.4

1 个答案:

答案 0 :(得分:0)

如果您仍然有package-lock.jsonnpm-shrinkwrap.json坐在附近,npm ls将会丢失相关的提示。

要强制npm ls仅查看文件系统,必须先运行此文件,然后才可以npm ls

npm config set shrinkwrap false && npm config set package-lock false