mall-admin-web icon indicating copy to clipboard operation
mall-admin-web copied to clipboard

构建失败

Open heihei180 opened this issue 3 years ago • 5 comments

Windows PowerShell 版权所有 (C) Microsoft Corporation。保留所有权利。

尝试新的跨平台 PowerShell https://aka.ms/pscore6

PS D:\code\html\mall-admin-web> npm install

[email protected] install D:\code\html\mall-admin-web\node_modules\node-sass node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-83_binding.node Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-83_binding.node":

connect ETIMEDOUT 52.74.223.119:443

Timed out whilst downloading the prebuilt binary

Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall D:\code\html\mall-admin-web\node_modules\webpack\node_modules\uglifyjs-webpack-plugin node lib/post_install.js

[email protected] postinstall D:\code\html\mall-admin-web\node_modules\node-sass node scripts/build.js

Building: D:\tools\nodejs\node.exe D:\code\html\mall-admin-web\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 'D:\tools\nodejs\node.exe', gyp verb cli 'D:\code\html\mall-admin-web\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 [email protected] gyp info using [email protected] | 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 "C:\Program Files\python" in the PATH gyp verb which failed Error: not found: C:\Program Files\python gyp verb which failed at getNotFoundError (D:\code\html\mall-admin-web\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\code\html\mall-admin-web\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\code\html\mall-admin-web\node_modules\which\which.js:80:29) gyp verb which failed at D:\code\html\mall-admin-web\node_modules\which\which.js:89:16 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) gyp verb which failed C:\Program Files\python Error: not found: C:\Program Files\python gyp verb which failed at getNotFoundError (D:\code\html\mall-admin-web\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\code\html\mall-admin-web\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\code\html\mall-admin-web\node_modules\which\which.js:80:29) gyp verb which failed at D:\code\html\mall-admin-web\node_modules\which\which.js:89:16 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) { gyp verb which failed code: 'ENOENT' gyp verb which failed } gyp verb could not find "C:\Program Files\python". checking python launcher gyp verb could not find "C:\Program Files\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 "C:\Program Files\python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\code\html\mall-admin-web\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder. (D:\code\html\mall-admin-web\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at D:\code\html\mall-admin-web\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqCallback.oncomplete (fs.js:183:21) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command "D:\tools\nodejs\node.exe" "D:\code\html\mall-admin-web\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd D:\code\html\mall-admin-web\node_modules\node-sass gyp ERR! node -v v14.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok Build failed with error code: 1 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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\2021-05-29T00_06_01_594Z-debug.log PS D:\code\html\mall-admin-web> npm install

[email protected] install D:\code\html\mall-admin-web\node_modules\node-sass node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-83_binding.node Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-83_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall D:\code\html\mall-admin-web\node_modules\node-sass node scripts/build.js

Building: D:\tools\nodejs\node.exe D:\code\html\mall-admin-web\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 'D:\tools\nodejs\node.exe', gyp verb cli 'D:\code\html\mall-admin-web\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 [email protected] gyp info using [email protected] | 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 "C:\Program Files\python" in the PATH gyp verb which failed Error: not found: C:\Program Files\python gyp verb which failed at getNotFoundError (D:\code\html\mall-admin-web\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\code\html\mall-admin-web\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\code\html\mall-admin-web\node_modules\which\which.js:80:29) gyp verb which failed at D:\code\html\mall-admin-web\node_modules\which\which.js:89:16 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) gyp verb which failed C:\Program Files\python Error: not found: C:\Program Files\python gyp verb which failed at getNotFoundError (D:\code\html\mall-admin-web\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\code\html\mall-admin-web\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\code\html\mall-admin-web\node_modules\which\which.js:80:29) gyp verb which failed at D:\code\html\mall-admin-web\node_modules\which\which.js:89:16 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) { gyp verb which failed code: 'ENOENT' gyp verb which failed } gyp verb could not find "C:\Program Files\python". checking python launcher gyp verb could not find "C:\Program Files\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 "C:\Program Files\python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\code\html\mall-admin-web\node_modules\node-gyp\lib\configure.js:484:19) PS D:\code\html\mall-admin-web> npm install

[email protected] install D:\code\html\mall-admin-web\node_modules\node-sass node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-83_binding.node Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.0/win32-x64-83_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall D:\code\html\mall-admin-web\node_modules\node-sass node scripts/build.js

Building: D:\tools\nodejs\node.exe D:\code\html\mall-admin-web\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 'D:\tools\nodejs\node.exe', gyp verb cli 'D:\code\html\mall-admin-web\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 [email protected] gyp info using [email protected] | 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 "C:\Program Files\python" in the PATH gyp verb which failed Error: not found: C:\Program Files\python gyp verb which failed at getNotFoundError (D:\code\html\mall-admin-web\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\code\html\mall-admin-web\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\code\html\mall-admin-web\node_modules\which\which.js:80:29) gyp verb which failed at D:\code\html\mall-admin-web\node_modules\which\which.js:89:16 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) gyp verb which failed C:\Program Files\python Error: not found: C:\Program Files\python gyp verb which failed at getNotFoundError (D:\code\html\mall-admin-web\node_modules\which\which.js:13:12) gyp verb which failed at F (D:\code\html\mall-admin-web\node_modules\which\which.js:68:19) gyp verb which failed at E (D:\code\html\mall-admin-web\node_modules\which\which.js:80:29) gyp verb which failed at D:\code\html\mall-admin-web\node_modules\which\which.js:89:16 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\index.js:42:5 gyp verb which failed at D:\code\html\mall-admin-web\node_modules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) { gyp verb which failed code: 'ENOENT' gyp verb which failed } gyp verb could not find "C:\Program Files\python". checking python launcher gyp verb could not find "C:\Program Files\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 "C:\Program Files\python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\code\html\mall-admin-web\node_modules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder. (D:\code\html\mall-admin-web\node_modules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at D:\code\html\mall-admin-web\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqCallback.oncomplete (fs.js:183:21) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command "D:\tools\nodejs\node.exe" "D:\code\html\mall-admin-web\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd D:\code\html\mall-admin-web\node_modules\node-sass gyp ERR! node -v v14.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok Build failed with error code: 1 npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of echarts@^4.1.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of echarts@>3.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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\2021-05-29T00_08_50_952Z-debug.log

heihei180 avatar May 29 '21 00:05 heihei180

这玩意构建还需要python 环境吗?

heihei180 avatar May 29 '21 00:05 heihei180

删除package-lock.json文件就能npm install构建成功

zjs9609 avatar Jun 24 '21 05:06 zjs9609

以管理员身份打开windows的cmd,执行 npm install --global --production [email protected] 能解决此问题,但又会遇到另一个问题。 根据 @zjs9609 描述的删除 package-lock.json文件 即能构建成功。

takeAction avatar Jun 30 '21 01:06 takeAction

遇到同样的问题,请问楼主解决了吗

AlivinFer avatar Aug 02 '21 09:08 AlivinFer

先删除 npm uninstall node-sass 再安装最新版本 npm install node-sass@latest

Da-wukong avatar Sep 29 '21 07:09 Da-wukong