一个新电脑上,saber启动报错

Saber 未结 2 3922
waw
waw 剑童 2019-12-20 12:46

启动报错 :

E:\ideaworkspace\Saber>yarn install

yarn install v1.21.1

[1/4] Resolving packages...

[2/4] Fetching packages...

warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js").

warning mini-css-extract-plugin@0.5.0: Invalid bin field for "mini-css-extract-plugin".

warning url-loader@1.1.2: Invalid bin field for "url-loader".

info fsevents@1.2.7: The platform "win32" is incompatible with this module.

info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.

info idb-connector@1.1.8: The platform "win32" is incompatible with this module.

info "idb-connector@1.1.8" is an optional dependency and failed compatibility check. Excluding it from installation.

[3/4] Linking dependencies...

warning " > sass-loader@7.1.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".

[4/4] Building fresh packages...

[1/2] ? yorkie

error E:\ideaworkspace\Saber\node_modules\node-sass: Command failed.

Exit code: 1

Command: node scripts/build.js

Arguments:

Directory: E:\ideaworkspace\Saber\node_modules\node-sass

Output:

Building: C:\Program Files\nodejs\node.exe E:\ideaworkspace\Saber\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 [ 'C:\\Program Files\\nodejs\\node.exe',

gyp verb cli   'E:\\ideaworkspace\\Saber\\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 info using node-gyp@3.8.0

gyp info using node@10.16.3 | 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 (E:\ideaworkspace\Saber\node_modules\which\which.js:13:12)

gyp verb `which` failed     at F (E:\ideaworkspace\Saber\node_modules\which\which.js:68:19)

gyp verb `which` failed     at E (E:\ideaworkspace\Saber\node_modules\which\which.js:80:29)

gyp verb `which` failed     at E:\ideaworkspace\Saber\node_modules\which\which.js:89:16

gyp verb `which` failed     at E:\ideaworkspace\Saber\node_modules\isexe\index.js:42:5

gyp verb `which` failed     at E:\ideaworkspace\Saber\node_modules\isexe\windows.js:36:5

gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)

gyp verb `which` failed  python2 { Error: not found: python2

gyp verb `which` failed     at getNotFoundError (E:\ideaworkspace\Saber\node_modules\which\which.js:13:12)

gyp verb `which` failed     at F (E:\ideaworkspace\Saber\node_modules\which\which.js:68:19)

gyp verb `which` failed     at E (E:\ideaworkspace\Saber\node_modules\which\which.js:80:29)

gyp verb `which` failed     at E:\ideaworkspace\Saber\node_modules\which\which.js:89:16

gyp verb `which` failed     at E:\ideaworkspace\Saber\node_modules\isexe\index.js:42:5

gyp verb `which` failed     at E:\ideaworkspace\Saber\node_modules\isexe\windows.js:36:5

gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)

gyp verb `which` failed   stack:

gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (E:\\ideaworkspace\\Saber\\node_modules\\which\\which.js:13:12)\n    at F (E:\\ideaworkspace\\Saber\\node_modules\\which\\which.js:68:19)\n

at E (E:\\ideaworkspace\\Saber\\node_modules\\which\\which.js:80:29)\n    at E:\\ideaworkspace\\Saber\\node_modules\\which\\which.js:89:16\n    at E:\\ideaworkspace\\Saber\\node_modules\\isexe\\index.js:42:5\n    at E:\\id

eaworkspace\\Saber\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:153:21)',

gyp verb `which` failed   code: 'ENOENT' }

gyp verb check python checking for Python executable "python" in the PATH

gyp verb `which` succeeded python E:\Anaconda3\python.EXE

gyp ERR! configure error

gyp ERR! stack Error: Command failed: E:\Anaconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];

gyp ERR! stack   File "", 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:294:12)

gyp ERR! stack     at ChildProcess.emit (events.js:198:13)

gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)

gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:389:11)

gyp ERR! stack     at Socket.emit (events.js:198:13)

gyp ERR! stack     at Pipe._handle.close (net.js:606:12)

gyp ERR! System Windows_NT 6.1.7601

gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\ideaworkspace\\Saber\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library

="

gyp ERR! cwd E:\ideaworkspace\Saber\node_modules\node-sass

gyp ERR! node -v v10.16.3

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok

Build failed with error code: 1





image.png

2条回答
  • 2019-12-20 14:29

    按照以下几种方法尝试下看看

     1. 尝试把nodejs版本卸载然后安装10.16.x的版本,删掉工程内node_modules目录,再重新执行

    npm install

     2. 若不行,则单独安装node-saas模块

    npm install node-sass --save

    然后再执行

    npm install

     3. 若还不行则执行 

    npm install -g node-gyp
    npm install --global --production windows-build-tools // 如果是windows7系统请安装windows-build-tools@1.4.2

    执行完毕后再执行 

    npm install


    3 讨论(0)
  • 2019-12-20 12:59

    我这是一台新的widnow7电脑

    0 讨论(0)
提交回复