我试图在我的项目上运行npm安装,我删除了节点模块来重新安装它,但是我的终端上有很多错误。我所做的就是在假定的文件夹中安装npm,但是仍然会出现错误。错误消息在此消息下面。谢谢
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTCxxMethod.h'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTCxxMethod.mm'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTCxxModule.h'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTCxxModule.mm'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTCxxUtils.h'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTCxxUtils.mm'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTNativeModule.h'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\APPname\node_modules\.staging\react-native-441da136\React\CxxModule\RCTNativeModule.mm'
npm ERR! code E404
npm ERR! 404 Not Found: preset@1.0.0
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ABC\AppData\Roaming\npm-cache\_logs\2020-10-22T06_34_20_827Z-debug.log这是我的package.json文件
{
"name": "App Name",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@datacamp/react-native-linear-gradient": "2.4.2",
"@dooboo-ui/native-switch-toggle": "0.7.0",
"@freakycoder/react-native-helpers": "^0.1.3",
"@paraboly/react-native-card": "^0.3.0",
"@react-native-community/async-storage": "1.11.0",
"@react-native-community/blur": "3.6.0",
"@react-native-community/datetimepicker": "2.6.1",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/netinfo": "5.9.5",
"@react-native-community/picker": "1.8.0",
"@react-native-community/slider": "3.0.3",
"@react-navigation/drawer": "5.9.0",
"@react-navigation/material-bottom-tabs": "5.2.16",
"@react-navigation/native": "5.7.3",
"@react-navigation/stack": "5.9.0",
"axios": "0.19.2",
"babel-eslint": "^10.1.0",
"datejs": "1.0.0-rc3",
"eslint-config-airbnb": "18.2.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jsx-a11y": "6.3.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-react": "7.20.5",
"eslint-plugin-react-native": "3.8.1",
"eslint-plugin-standard": "4.0.1",
"expo": "39.0.3",
"expo-font": "8.3.0",
"jetifier": "1.6.6",
"moment": "2.27.0",
"moment-timezone": "0.5.31",
"native-base": "2.13.13",
"preset": "1.0.0",
"prop-types": "15.7.2",
"react": "16.13.1",
"react-highlight-selection": "^1.0.2",
"react-native": "0.63.2",
"react-native-animatable": "1.3.3",
"react-native-bouncy-touchable": "^1.0.0",
"react-native-cardview": "2.0.5",
"react-native-chart-kit": "6.4.1",
"react-native-check-box": "2.1.7",
"react-native-confetti-cannon": "^1.5.1",
"react-native-contacts": "^6.0.1",
"react-native-datepicker": "1.7.2",
"react-native-device-info": "5.6.5",
"react-native-document-picker": "3.5.4",
"react-native-drop-down-item": "1.1.0",
"react-native-dropdown-picker": "3.6.8",
"react-native-dynamic-vector-icons": "^1.1.4",
"react-native-elements": "^2.1.0",
"react-native-exception-handler": "2.10.8",
"react-native-extra-dimensions-android": "1.2.5",
"react-native-firebase": "5.6.0",
"react-native-gesture-handler": "1.8.0",
"react-native-google-places-autocomplete": "1.8.3",
"react-native-google-recaptcha-v2": "1.1.0",
"react-native-google-signin": "2.1.1",
"react-native-image-crop-picker": "^0.32.2",
"react-native-image-slider-box": "1.0.12",
"react-native-keyboard-aware-scroll-view": "0.9.2",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^1.4.1",
"react-native-masked-text": "^1.13.0",
"react-native-material-bottom-navigation": "^1.0.5",
"react-native-material-dropdown": "^0.11.1",
"react-native-material-menu": "^1.1.3",
"react-native-modal": "^11.5.6",
"react-native-modal-datetime-picker": "^8.8.0",
"react-native-modalize": "2.0.6",
"react-native-motion-slider": "^1.0.3",
"react-native-multiple-select": "^0.5.5",
"react-native-paper": "^4.0.1",
"react-native-permissions": "^2.1.5",
"react-native-picker-select": "^8.0.0",
"react-native-popover-view": "^3.0.3",
"react-native-push-notification-popup": "^1.4.0",
"react-native-rate": "^1.2.1",
"react-native-raw-bottom-sheet": "^2.2.0",
"react-native-really-awesome-button": "^1.6.0",
"react-native-reanimated": "^1.10.1",
"react-native-render-html": "^4.2.2",
"react-native-responsive-screen": "1.4.1",
"react-native-restart": "0.0.17",
"react-native-root-toast": "^3.2.1",
"react-native-safe-area-context": "^3.1.1",
"react-native-screens": "^2.9.0",
"react-native-searchable-dropdown": "^1.1.1",
"react-native-select-contact": "^1.5.0",
"react-native-share": "^3.7.0",
"react-native-signature-capture": "^0.4.10",
"react-native-simple-radio-button": "^2.7.4",
"react-native-slider": "^0.11.0",
"react-native-slideshow": "^1.0.1",
"react-native-slowlog": "^1.0.2",
"react-native-smart-statusbar": "^1.0.17",
"react-native-star-rating": "^1.1.0",
"react-native-svg": "^12.1.0",
"react-native-swipe-list-view": "^3.2.3",
"react-native-swiper": "^1.6.0",
"react-native-swiper-flatlist": "^2.0.4",
"react-native-switch-toggle": "^1.1.4",
"react-native-text-gradient": "^0.1.7",
"react-native-textinput-effects": "^0.6.1",
"react-native-vector-icons": "^7.1.0",
"react-native-video": "^5.1.0-alpha8",
"react-native-webview": "^10.3.3",
"react-navigation": "^4.4.0",
"react-navigation-stack": "^2.8.2",
"react-navigation-tabs": "^2.9.0",
"react-phone-number-input": "^3.0.25",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"rn-fetch-blob": "^0.12.0",
"styled-components": "^5.2.0",
"validate.js": "^0.13.1"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/runtime": "^7.11.1",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.2.2",
"eslint": "^7.6.0",
"jest": "^26.2.2",
"metro-react-native-babel-preset": "^0.61.0",
"react-test-renderer": "^16.13.1"
},
"rnpm": {
"assets": [
"./assets/fonts"
]
},
"assetBundlePatterns": [
"assets/images/*"
],
"jest": {
"preset": "react-native"
}}
发布于 2020-10-22 08:55:03
生成的所有以前的缓存。
npm cache clean --forcepackage-lock.json
现在,通过将此命令运行到您的path项目根目录,
npm install发布于 2020-10-24 07:07:04
根据以下错误:
没有可用的预置有效版本
并在preset npmjs中搜索您会注意到的包,在npmjs中没有任何名称为preset的包。
https://www.npmjs.com/search?q=preset
如果您删除了您的preset中的package.json依赖项,您就可以完美地安装
"preset": "1.0.0",发布于 2020-10-22 07:05:08
请尝试删除package-lock.json和npm重新安装。
https://stackoverflow.com/questions/64476904
复制相似问题