繁体   English   中英

npm 安装不工作,从 git 克隆我的项目后无法安装任何节点模块

[英]npm install not working, can't install any of the node modules after cloning my project from git

我已经从 git 克隆了我的项目,当尝试npm install时,它不起作用。

我无法修复任何错误 - 例如,当尝试使用npm install --save core-js@^3修复 core-js 错误时,我仍然收到相同的消息,我需要升级。

为什么会这样? 在我克隆这个 repo 之前没有错误?

npm WARN deprecated @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! path C:\Users\User\Desktop\mydailyprep\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@14.16.1 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (child_process.js:308:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Windows_NT 10.0.17134
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\Desktop\\myapp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\User\Desktop\mydailyprep\node_modules\node-sass
npm ERR! gyp ERR! node -v v14.16.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Local\npm-cache\_logs\2021-04-09T10_33_10_047Z-debug.log

尝试:

npm cache clean --force
npm install

即使我面临同样的问题......可能这可能对你有帮助.. :)

我创建了一个名为“项目(文件夹名称)”的文件夹,其中我已经克隆了我的项目 - 名为“xyz 项目(项目 >> xyz 项目)”..

现在我错误地尝试安装 - npm 安装在“项目文件夹(父文件夹)”中..

但节点模块必须安装在“xyz 项目”(子文件夹)中

因此,当我在 xyz 项目中使用 npm i... 时,节点模块已成功安装...

尝试这个..

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM