当npm install 的时候,报如下错误:
Building: G:\nodejs\node.exe F:\test\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'G:\\nodejs\\node.exe',
gyp verb cli 'F:\\test\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.13.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (F:\test\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (F:\test\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (F:\test\node_modules\which\which.js:80:29)
gyp verb `which` failed at F:\test\node_modules\which\which.js:89:16
gyp verb `which` failed at F:\test\node_modules\isexe\index.js:42:5
gyp verb `which` failed at F:\test\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (F:\test\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (F:\test\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (F:\test\node_modules\which\which.js:80:29)
gyp verb `which` failed at F:\test\node_modules\which\which.js:89:16
gyp verb `which` failed at F:\test\node_modules\isexe\index.js:42:5
gyp verb `which` failed at F:\test\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed stack: 'Error: not found: python2\n' +
gyp verb `which` failed ' at getNotFoundError (F:\\test\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed ' at F (F:\\test\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed ' at E (F:\\test\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed ' at F:\\test\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed ' at F:\\test\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed ' at F:\\test\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed ' at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python G:\Python\Python37-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: G:\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:295:12)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "G:\\nodejs\\node.exe" "F:\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsas
s_library="
gyp ERR! cwd F:\test\node_modules\node-sass
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 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\Administrator\AppData\Roaming\npm-cache\_logs\2019-11-18T07_33_10_767Z-debug.log
Process finished with exit code 1
解决办法:
- 运行 npm install --global windows-build-tools --save
- 再安装node-sass npm install node-sass --save
到这里,错误应该就已经解决了。
如果 node-sass 安装不上的话可以试试用 cnpm 镜像安装。
当npm install 的时候,报如下错误:Building: G:\nodejs\node.exe F:\test\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=gyp info it worked if it ends with okgyp verb cli [gyp verb cli
删除 node_modules 文件夹。
在 Terminal 运行 npm install --global windows-build-tools --save
再安装node-sass npm install node-sass@4.12.0 --save(或指定版本)
到这里,错误应该就已经解决了,收到了 gyp info ok 的提示!
如果遇到 Node Sass could not find a binding for your current environment,再运行 npm reb.
降级 : npm install -g npm@5.4.0
升级 : npm install -g npm 升级到最新版
结果降级之后再尝试的时候就直接报版本跟node.js不兼容的问题,然后各种在升级都不好使,只能重新删掉在升级
npm报错以及卸载node
C:\Users\Administrator\Desktop\vue>npm install
WARNING: You are likely us
gyp verb check python checking for Python executable "python2.7" in the PATH
gyp verb `which` failed Error: not found: python2.7
gyp verb `which` failed at getNotFoundError (D:\Code\renren-fast-vue\node_modules\which\which.js:13:12)
gyp verb `which` fa
项目安装的时候报
npm - gyp verb check python checking for Python executable “python2“ in the PATH
node sass 需要依赖python,只好先装上python,过程不细说
装好之后,报错依旧。
原因分析:
会不会是装python的时候环境变量设置的python.exe这里是python2.exe,于是将python.exe复制一份改个名字python2
项目场景: gyp verb check python checking for Python executable “python2” in the PATH
node v16.15.0
npm 8.5.5
npm install 报错
gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not fou
shell管理员身份到该文件夹下执行 node index.js
可以下载到python2
到环境变量“Path”变量下添加此版本的路径,(真实路径/软链接都可,我此处用的软链接)
%USERPROFILE%.windows-build-tools\python27
%USERPROFILE%.windows-build-tools\python27\Scripts
保存,再外层也保存
npm install --gl
这个错误是由于在安装某些 npm 包时,需要使用 Python 解释器来编译一些本地模块,但是无法找到可用的 Python 解释器。具体来说,它在尝试执行命令 "gyp verb check python" 时发生错误,该命令用于检查 Python 解释器是否可用。
为了解决这个问题,你可以尝试以下几种方法:
1. 安装 Python 解释器。你可以从 Python 官方网站(https://www.python.org/downloads/)下载并安装 Python。
2. 将 Python 加入系统环境变量。在 Windows 操作系统中,你可以将 Python 的安装路径添加到 PATH 环境变量中。在 macOS 或 Linux 操作系统中,你可以将 Python 的可执行文件路径添加到 PATH 环境变量中。
3. 使用 nvm 切换到其他版本的 Node.js。有时,此错误可能是由于 Node.js 版本与所需的 Python 版本不兼容造成的。你可以使用 nvm(Node Version Manager)来切换到另一个 Node.js 版本,以查看是否解决了问题。
希望这些方法能够帮助你解决问题。如果还有问题,请随时向我提问。
has been blocked by CORS policy: The request client is not a secure context and the resource is in..
19516
错误because its MIME type (text/html) is not a supported stylesheet MIME type, and strict MIME checkin
16088
npm install 报错 check python checking for Python executable python2 in the PATH
a158086780:
为什么 fetch 要用两次 then 才能取出数据
@_@224:
elementUI中的el-image 加载失败原因和解决方案
pengyin_923:
axios.defaults.withCredentials = true 前端跨域传递Cookie设置
Elsy95:
has been blocked by CORS policy: The request client is not a secure context and the resource is in..
cuilll:
vite C:\Users\dell\AppData\Roaming\npm-cache\_npx\12088\node_modules\create-vite\index.js:3
vue-router连续跳转同一路由页面,页面不刷新的解决办法