gpt4 book ai didi

can't install node module in exiting project based on React.js with native(无法在现有的基于React.js的项目中安装节点模块)

转载 作者:bug小助手 更新时间:2023-10-22 13:50:26 39 4
gpt4 key购买 nike



Getting error when I run npm install I want run the exiting react project with react native both project combine in one.

当我运行npm安装时出错,我想用react原生运行退出的react项目,两个项目合并在一起。


i have install nvm for change node version with npm
error image
node verison and npm version

我已经安装了用于更改节点版本的nvm,带有npm错误映像节点verison和npm版本


npm WARN deprecated @types/[email protected]: This is a stub types definition. pusher-js provides its own type definitions, so you do not need this installed.
npm WARN deprecated @types/[email protected]: This is a stub types definition. concurrently provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: dommatrix is no longer maintained. Please use @thednp/dommatrix.
npm WARN deprecated [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm ERR! code 1
npm ERR! path D:\Brijesh\react js\HG\Expensify\App\node_modules\shellcheck
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c ./install.sh
npm ERR! '.' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\brije\AppData\Local\npm-cache\_logs\2023-09-11T06_29_30_567Z-debug-0.log

package json like below

包json如下


{
"name": "new.expensify",
"version": "1.3.66-3",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
"license": "MIT",
"private": true,
"scripts": {
"configure-mapbox": "scripts/setup-mapbox-sdk-walkthrough.sh",
"postinstall": "scripts/postInstall.sh",
"clean": "npx react-native clean-project-auto",
"android": "scripts/set-pusher-suffix.sh && npx react-native run-android --variant=developmentDebug --appId=com.expensify.chat.dev",
"ios": "scripts/set-pusher-suffix.sh && npx react-native run-ios --configuration=\"Debug Development\" --scheme=\"New Expensify Dev\"",
"pod-install": "cd ios && bundle exec pod install",
"ipad": "concurrently \"npx react-native run-ios --simulator=\\\"iPad Pro (12.9-inch) (6th generation)\\\" --configuration=\\\"Debug Development\\\" --scheme=\\\"New Expensify Dev\\\"\"",
"ipad-sm": "concurrently \"npx react-native run-ios --simulator=\\\"iPad Pro (11-inch) (4th generation)\\\" --configuration=\\\"Debug Development\\\" --scheme=\\\"New Expensify Dev\\\"\"",
"start": "npx react-native start",
"web": "scripts/set-pusher-suffix.sh && concurrently npm:web-proxy npm:web-server",
"web-proxy": "node web/proxy.js",
"web-server": "webpack-dev-server --open --config config/webpack/webpack.dev.js",
"build": "webpack --config config/webpack/webpack.common.js --env envFile=.env.production",
"build-staging": "webpack --config config/webpack/webpack.common.js --env envFile=.env.staging",
"build-adhoc": "webpack --config config/webpack/webpack.common.js --env envFile=.env.adhoc",
"desktop": "scripts/set-pusher-suffix.sh && node desktop/start.js",
"desktop-build": "scripts/build-desktop.sh production",
"desktop-build-staging": "scripts/build-desktop.sh staging",
"createDocsRoutes": "node .github/scripts/createDocsRoutes.js",
"desktop-build-adhoc": "scripts/build-desktop.sh adhoc",
"ios-build": "fastlane ios build",
"android-build": "fastlane android build",
"android-build-e2e": "bundle exec fastlane android build_e2e",
"test": "TZ=utc jest",
"typecheck": "tsc",
"lint": "eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/eslint",
"lint-changed": "eslint --fix $(git diff --diff-filter=AM --name-only main -- \"*.js\" \"*.ts\" \"*.tsx\")",
"lint-watch": "npx eslint-watch --watch --changed",
"shellcheck": "./scripts/shellCheck.sh",
"prettier": "prettier --write .",
"prettier-watch": "onchange \"**/*.{js,ts,tsx}\" -- prettier --write --ignore-unknown {{changed}}",
"print-version": "echo $npm_package_version",
"storybook": "start-storybook -p 6006",
"storybook-build": "ENV=production build-storybook -o dist/docs",
"storybook-build-staging": "ENV=staging build-storybook -o dist/docs",
"gh-actions-build": "./.github/scripts/buildActions.sh",
"gh-actions-validate": "./.github/scripts/validateActionsAndWorkflows.sh",
"analyze-packages": "ANALYZE_BUNDLE=true webpack --config config/webpack/webpack.common.js --env envFile=.env.production",
"symbolicate:android": "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map",
"symbolicate:ios": "npx metro-symbolicate main.jsbundle.map",
"test:e2e": "node tests/e2e/testRunner.js --development"
},
"dependencies": {
"@expensify/react-native-web": "0.18.15",
"@formatjs/intl-getcanonicallocales": "^2.2.0",
"@formatjs/intl-listformat": "^7.2.2",
"@formatjs/intl-locale": "^3.3.0",
"@formatjs/intl-numberformat": "^8.5.0",
"@formatjs/intl-pluralrules": "^5.2.2",
"@gorhom/portal": "^1.0.14",
"@invertase/react-native-apple-authentication": "^2.2.2",
"@oguzhnatly/react-native-image-manipulator": "github:Expensify/react-native-image-manipulator#5cdae3d4455b03a04c57f50be3863e2fe6c92c52",
"@onfido/react-native-sdk": "7.4.0",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-camera-roll/camera-roll": "5.4.0",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native-community/netinfo": "^9.3.10",
"@react-native-firebase/analytics": "^12.3.0",
"@react-native-firebase/app": "^12.3.0",
"@react-native-firebase/crashlytics": "^12.3.0",
"@react-native-firebase/perf": "^12.3.0",
"@react-native-google-signin/google-signin": "^10.0.1",
"@react-native-picker/picker": "^2.4.3",
"@react-navigation/material-top-tabs": "^6.6.3",
"@react-navigation/native": "6.1.6",
"@react-navigation/stack": "6.3.16",
"@react-ng/bounds-observer": "^0.2.1",
"@rnmapbox/maps": "^10.0.11",
"@ua/react-native-airship": "^15.2.6",
"awesome-phonenumber": "^5.4.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-polyfill": "^6.26.0",
"canvas-size": "^1.2.6",
"core-js": "^3.32.0",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"expensify-common": "git+ssh://[email protected]/Expensify/expensify-common.git#e63d06e239fe5b2f221e86eab71ae8a4e3b8bee3",
"fbjs": "^3.0.2",
"htmlparser2": "^7.2.0",
"idb-keyval": "^6.2.1",
"jest-when": "^3.5.2",
"lodash": "4.17.21",
"lottie-react-native": "^5.1.6",
"mapbox-gl": "^2.15.0",
"moment": "^2.29.4",
"moment-timezone": "^0.5.31",
"onfido-sdk-ui": "13.1.0",
"patch-package": "^8.0.0",
"process": "^0.11.10",
"prop-types": "^15.7.2",
"pusher-js": "7.4.0",
"react": "18.2.0",
"react-collapse": "^5.1.0",
"react-content-loader": "^6.1.0",
"react-dom": "18.1.0",
"react-map-gl": "^7.1.3",
"react-native": "0.72.3",
"react-native-blob-util": "^0.17.3",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.5",
"react-native-dev-menu": "^4.1.1",
"react-native-device-info": "^10.3.0",
"react-native-document-picker": "^8.0.0",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "2.12.0",
"react-native-google-places-autocomplete": "git+https://github.com/Expensify/react-native-google-places-autocomplete.git#ee87343c3e827ff7818abc71b6bb04fcc1f120e0",
"react-native-haptic-feedback": "^1.13.0",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-image-picker": "^5.1.0",
"react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#8393b7e58df6ff65fd41f60aee8ece8822c91e2b",
"react-native-key-command": "^1.0.1",
"react-native-linear-gradient": "^2.8.1",
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.72",
"react-native-pager-view": "^6.2.0",
"react-native-pdf": "^6.7.1",
"react-native-performance": "^4.0.0",
"react-native-permissions": "^3.0.1",
"react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#eae05855286dc699954415cc1d629bfd8e8e47e2",
"react-native-plaid-link-sdk": "^10.0.0",
"react-native-qrcode-svg": "^6.2.0",
"react-native-quick-sqlite": "^8.0.0-beta.2",
"react-native-reanimated": "3.4.0",
"react-native-render-html": "6.3.1",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "3.21.0",
"react-native-svg": "^13.9.0",
"react-native-tab-view": "^3.5.2",
"react-native-url-polyfill": "^2.0.0",
"react-native-view-shot": "^3.6.0",
"react-native-vision-camera": "^2.15.4",
"react-native-web-linear-gradient": "^1.1.2",
"react-native-web-lottie": "^1.4.4",
"react-native-webview": "^11.17.2",
"react-pdf": "^6.2.2",
"react-plaid-link": "3.3.2",
"react-web-config": "^1.0.0",
"react-window": "^1.8.9",
"save": "^2.4.0",
"semver": "^7.5.2",
"shim-keyboard-event-key": "^1.0.3",
"underscore": "^1.13.1"
},
"devDependencies": {
"@actions/core": "1.10.0",
"@actions/github": "5.1.1",
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@babel/preset-env": "^7.20.0",
"@babel/preset-flow": "^7.12.13",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.21.5",
"@babel/runtime": "^7.20.0",
"@electron/notarize": "^1.2.3",
"@jest/globals": "^29.5.0",
"@octokit/core": "4.0.4",
"@octokit/plugin-paginate-rest": "3.1.0",
"@octokit/plugin-throttling": "4.1.0",
"@react-native-community/eslint-config": "3.0.0",
"@react-native/metro-config": "^0.72.9",
"@react-navigation/devtools": "^6.0.10",
"@storybook/addon-a11y": "^6.5.9",
"@storybook/addon-essentials": "^7.0.0",
"@storybook/addon-react-native-web": "0.0.19--canary.37.cb55428.0",
"@storybook/addons": "^6.5.9",
"@storybook/builder-webpack5": "^6.5.10",
"@storybook/manager-webpack5": "^6.5.10",
"@storybook/react": "^6.5.9",
"@storybook/theming": "^6.5.9",
"@svgr/webpack": "^6.0.0",
"@testing-library/jest-native": "5.4.1",
"@testing-library/react-native": "11.5.1",
"@types/concurrently": "^7.0.0",
"@types/jest": "^29.5.2",
"@types/jest-when": "^3.5.2",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.195",
"@types/mapbox-gl": "^2.7.13",
"@types/mock-fs": "^4.13.1",
"@types/pusher-js": "^5.1.0",
"@types/react": "^18.2.12",
"@types/react-collapse": "^5.0.1",
"@types/react-dom": "^18.2.4",
"@types/react-pdf": "^5.7.2",
"@types/react-test-renderer": "^18.0.0",
"@types/semver": "^7.5.0",
"@types/setimmediate": "^1.0.2",
"@types/underscore": "^1.11.5",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"@vercel/ncc": "^0.27.0",
"@welldone-software/why-did-you-render": "7.0.1",
"ajv-cli": "^5.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "29.4.1",
"babel-loader": "^9.1.3",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-react-native-web": "^0.18.7",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"clean-webpack-plugin": "^3.0.0",
"concurrently": "^5.3.0",
"copy-webpack-plugin": "^6.4.1",
"css-loader": "^6.7.2",
"diff-so-fancy": "^1.3.0",
"dotenv": "^16.0.3",
"electron": "^25.4.0",
"electron-builder": "24.5.0",
"eslint": "^7.6.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-expensify": "^2.0.38",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest": "^24.1.0",
"eslint-plugin-jsdoc": "^46.2.6",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native-a11y": "^3.3.0",
"eslint-plugin-storybook": "^0.5.13",
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
"html-webpack-plugin": "^5.5.0",
"jest": "29.4.1",
"jest-circus": "29.4.1",
"jest-cli": "29.4.1",
"jest-environment-jsdom": "^29.4.1",
"metro-react-native-babel-preset": "0.76.7",
"mock-fs": "^4.13.0",
"onchange": "^7.1.0",
"portfinder": "^1.0.28",
"prettier": "^2.8.8",
"pusher-js-mock": "^0.3.3",
"react-native-clean-project": "^4.0.0-alpha4.0",
"react-native-flipper": "https://gitpkg.now.sh/facebook/flipper/react-native/react-native-flipper?9cacc9b59402550eae866e0e81e5f0c2f8203e6b",
"react-native-performance-flipper-reporter": "^2.0.0",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.2.0",
"reassure": "^0.9.0",
"setimmediate": "^1.0.5",
"shellcheck": "^1.1.0",
"style-loader": "^2.0.0",
"time-analytics-webpack-plugin": "^0.1.17",
"type-fest": "^3.12.0",
"typescript": "^5.1.6",
"wait-port": "^0.2.9",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-font-preload-plugin": "^1.5.0",
"webpack-merge": "^5.8.0"
},
"overrides": {
"react-native": "$react-native"
},
"electronmon": {
"patterns": [
"!node_modules",
"!node_modules/**/*",
"!**/*.map",
"!ios/**",
"!android/**",
"*.test.*",
"*.spec.*"
]
},
"engines": {
"node": "16.15.1",
"npm": "8.11.0"
}
}

I have also try with clean npm cache and remove package-lock and then npm install but still not working.

我也尝试过清理npm缓存,删除包锁定,然后安装npm,但仍然无法工作。


if you have any idea please let me know.

如果你有什么想法,请告诉我。


I have try using Mac PC, with brew with nvm this is working fine but in my window laptop this is not working because brew is not supported in window so I go through direct nvm for node version change.

我尝试过使用Mac PC,使用带有nvm的brew,这很好,但在我的windows笔记本电脑中,这不起作用,因为brew在windows中不受支持,所以我直接通过nvm进行节点版本更改。


I'm expecting install node module in exiting project in Window this is working in fine in Mac PC.

我希望在Window中的退出项目中安装节点模块,这在Mac电脑中运行良好。


Thanks you.

谢谢你。


更多回答

Which package manager are you using?

您正在使用哪个软件包管理器?

npm package manager

npm包管理器

Try to use yarn for this

试着用纱线做这个

优秀答案推荐

Here are some additional steps you can try to troubleshoot and resolve the problem:

以下是一些可以尝试排除故障并解决问题的附加步骤:



  1. Upgrade npm: Your project specifies npm version 8.11.0, which is a relatively old version. Try upgrading npm to a more recent version, as older versions may have compatibility issues:


    npm install -g npm@latest




After upgrading npm, try running npm install again.

升级npm后,请尝试再次运行npm install。



  1. Run as Administrator: In some cases, permissions issues can prevent npm from working correctly on Windows. Try running your terminal or command prompt as an administrator and then running npm install.



  2. Antivirus/Security Software: Some antivirus or security software on your Windows machine might interfere with the installation process. Try temporarily disabling such software while running npm install to see if it resolves the issue.



  3. Use Yarn: Consider using Yarn as an alternative package manager to npm. Yarn is known to be more reliable in certain situations. You can install Yarn globally and then use it to install dependencies:


    npm install -g yarn
    yarn install



  4. Install Windows-Build-Tools: If your project has dependencies with native code that require compilation (e.g., node-gyp), you may need to install the windows-build-tools package globally to ensure that compilation tools are available:


    npm install -g windows-build-tools




更多回答

npm install -g windows-build-tools this package is deprecated any alternative solution simply i want run the run code clone and try into window pc and let me know if start this project without any issues github.com/Expensify/App

npm install-g windows构建工具这个包不推荐使用任何替代解决方案,我只想运行运行代码克隆并尝试进入windows pc,让我知道是否在没有任何问题的情况下启动这个项目github.com/Expensify/App

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com