【问题标题】:Npm Install giving errorsNpm Install 给出错误
【发布时间】:2020-09-21 18:46:17
【问题描述】:

请帮忙,我试图在一个克隆项目上运行 npm install,但在我的终端上出现了很多错误。我所做的只是在假定的文件夹中安装 npm ,但仍然出现错误。错误消息位于此消息下方。谢谢

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\user\OneDrive\Desktop\DevcareerReactTasks\votingtask2\Devcareer_voting_system\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\user\OneDrive\Desktop\DevcareerReactTasks\votingtask2\Devcareer_voting_system\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (C:\Users\user\OneDrive\Desktop\DevcareerReactTasks\votingtask2\Devcareer_voting_system\node_modules\graceful-fs\polyfills.js:295:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:168:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\OneDrive\\Desktop\\DevcareerReactTasks\\votingtask2\\Devcareer_voting_system\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\user\OneDrive\Desktop\DevcareerReactTasks\votingtask2\Devcareer_voting_system\node_modules\node-sass
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN bootstrap@4.5.2 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.5.2 requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependencies yourself.
npm WARN big-brother-dev-career@1.0.0 No repository field.
npm WARN big-brother-dev-career@1.0.0 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2020-09-21T10_19_34_986Z-debug.log
`

【问题讨论】:

  • 据我所知,Python 不见了。安装它here。
  • 你的依赖node-sass 需要node-gyp 需要在系统上安装python。

标签: node.js reactjs sass command-line-interface


【解决方案1】:

你试过this方法吗?

npm --add-python-to-path='true'

【讨论】:

    猜你喜欢
    • 2018-02-26
    • 2018-10-17
    • 1970-01-01
    • 2022-01-06
    • 2020-08-14
    • 2021-02-27
    • 2021-02-05
    • 1970-01-01
    • 2021-12-18
    相关资源
    最近更新 更多