当前位置: 首页 > 工具软件 > node-launcher > 使用案例 >

node-sass安装失败

呼延原
2023-12-01

node-sass安装失败

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 (E:\amanda\hk\h5-easylink\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\amanda\hk\h5-easylink\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\amanda\hk\h5-easylink\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (E:\amanda\hk\h5-easylink\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\amanda\hk\h5-easylink\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\amanda\hk\h5-easylink\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176: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` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (E:\amanda\hk\h5-easylink\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\amanda\hk\h5-easylink\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\amanda\hk\h5-easylink\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (E:\amanda\hk\h5-easylink\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (E:\amanda\hk\h5-easylink\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (E:\amanda\hk\h5-easylink\node_modules\which\which.js:80:29)
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\which\which.js:89:16
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at E:\amanda\hk\h5-easylink\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (E:\amanda\hk\h5-easylink\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (E:\amanda\hk\h5-easylink\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (E:\amanda\hk\h5-easylink\node_modules\graceful-fs\polyfills.js:295:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:176:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "F:\\env\\node\\node.exe" "E:\\amanda\\hk\\h5-easylink\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\amanda\hk\h5-easylink\node_modules\node-sass
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN sass-loader@8.0.0 requires a peer of webpack@^4.36.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package axios is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.13.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.13.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\liliuao\AppData\Roaming\npm-cache\_logs\2020-09-08T02_22_33_463Z-debug.log

1、安装windows-build-tools

npm install --global --production windows-build-tools

2、安装node-gyp

npm install --global node-gyp

重新npm install
若依旧报错

3.npm切换淘镜像

npm config set registry https://registry.npm.taobao.org

配置后验证:

npm config get registry

可安装nrm【npm数据源管理工具】:npm i -g nrm
镜像清单:

 npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
* taobao - http://registry.npm.taobao.org/
  edunpm - http://registry.enpmjs.org/
  eu ----- http://registry.npmjs.eu/
  au ----- http://registry.npmjs.org.au/
  sl ----- http://npm.strongloop.com/
  nj ----- https://registry.nodejitsu.com/
  pt ----- http://registry.npmjs.pt/

4.重新安装node-sass

npm install node-sass

重新npm install

 类似资料: