简体   繁体   English

使用 npm 时安装失败

[英]installation fails while using npm

    C:\Users\admin\Downloads\cyberq_frontend-dev\cyberq_frontend-dev\ui\www>npm installnpm ERR! 
    code 1
    npm ERR! path E:\SecLogic\cyberq_frontend\ui\www\node_modules\node-sass
    npm ERR! command failed
    npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
    npm ERR! Building: C:\Program Files\nodejs\node.exe 
    E:\SecLogic\cyberq_frontend\ui\www\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose -- 
    libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
     npm ERR! gyp info it worked if it ends with ok
    npm ERR! gyp verb cli [
    npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
    npm ERR! gyp verb cli   'E:\\SecLogic\\cyberq_frontend\\ui\\www\\node_modules\\node- 
    gyp\\bin\\node-gyp.js',
    npm ERR! gyp verb cli   'rebuild',
    npm ERR! gyp verb cli   '--verbose',
    npm ERR! gyp verb cli   '--libsass_ext=',
    npm ERR! gyp verb cli   '--libsass_cflags=',
    npm ERR! gyp verb cli   '--libsass_ldflags=',
    npm ERR! gyp verb cli   '--libsass_library='
    npm ERR! gyp verb cli ]
    npm ERR! gyp info using node-gyp@3.8.0
    npm ERR! gyp info using node@16.13.0 | win32 | x64
    npm ERR! gyp verb command rebuild []
    npm ERR! gyp verb command clean []
    npm ERR! gyp verb clean removing "build" directory
    npm ERR! gyp verb command configure []
    npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
    npm ERR! gyp verb `which` failed Error: not found: python2
    npm ERR! gyp verb `which` failed     at getNotFoundError (

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\subha\AppData\Local\npm-cache\_logs\2021-11-30T13_17_26_822Z-debug.log

You just pasted your whole error log.您刚刚粘贴了整个错误日志。 I don't have any idea what you did and how this error was thrown.我不知道你做了什么以及这个错误是如何引发的。 Anyway with some hunch I'm guessing you updated your node version after you did npm install on your project.无论如何,我猜你在你的项目上npm install之后更新了你的节点版本。 The error is likely caused by node-sass which totally depends on the version of node.该错误可能是由node-sass引起的,它完全取决于 node 的版本。

So, I suggest you to first try this command npm rebuild node-sass .所以,我建议你先试试这个命令npm rebuild node-sass And if this won't help then remove node_modules/ and do npm install again.如果这没有帮助,那么删除node_modules/并再次npm install

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

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