前阵子研究npm私有库时,将node升级最新版本了,然后发现之前装的是32位的node,于是乎我就改成64的了,悲惨之路从这里开始~~~
之前的项目倒是还能跑,但是一旦我重装就狗带了
client@1.0.0 dev F:\06技术积累\01技术代码\01main\GISShow\client
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache\_logs\2020-05-08T02_15_10_478Z-debug.log
PS F:\06技术积累\01技术代码\01main\GISShow\client> cnpm install
| [17/72] Installing safe-buffer@^5.0.1platform unsupported babel-loader@7.1.5 › webpack@3.12.0 › watchpack@1.6.1 › chokidar@2.1.8 › fsevents@^1.2.7 Package require os(darwin) not compatible with your platform(win32)
/ [17/72] Installing safe-buffer@^5.0.1[fsevents@^1.2.7] optional install error: Package require os(darwin) not compatible
with your platform(win32)
- [56/72] Installing request@^2.87.0platform unsupported sass@1.26.5 › chokidar@3.4.0 › fsevents@~2.1.2 Package require os(darwin) not compatible with your platform(win32)
\ [56/72] Installing vue-loader@^13.3.0[fsevents@~2.1.2] optional install error: Package require os(darwin) not compatible
with your platform(win32)
√ Installed 72 packages
√ Linked 1076 latest versions
ChromeDriver binary exists. Validating...
ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1)
ChromeDriver is already available at 'C:\Users\wsl\AppData\Local\Temp\2.46\chromedriver\chromedriver.exe'.
Copying to target path F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_chromedriver@2.46.0@chromedriver\lib\chromedriver
Done. ChromeDriver binary available at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_chromedriver@2.46.0@chromedriver\lib\chromedriver\chromedriver.exe
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
Cached binary found at C:\Users\wsl\.npminstall_tarball\node-sass\4.14.1\win32-x64-79_binding.node
Binary found at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-sass@4.14.1@node-sass\vendor\win32-x64-79\binding.node
Testing binary
Binary has a problem: Error: \\?\F:\06ææ¯ç§¯ç´¯\01ææ¯ä»£ç \01main\GISShow\client\node_modules\_node-sass@4.
14.1@node-sass\vendor\win32-x64-79\binding.node is not a valid Win32 application.
\\?\F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-sass@4.14.1@node-sass\vendor\win32-x64-79\binding.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1197:18)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Module.require (internal/modules/cjs/loader.js:1036:19)
at require (internal/modules/cjs/helpers.js:72:18)
at module.exports (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-sass@4.14.1@node-sass\lib\binding.js:19:10)
at Object.<anonymous> (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-sass@4.14.1@node-sass\lib\index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
Building the binary locally
Building: D:\Program Files\nodejs\node.exe F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-gyp@3.8.0@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:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_node-gyp@3.8.0@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@13.12.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb download using dist-url https://npm.taobao.org/mirrors/node
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:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:13:12)
gyp verb `which` failed at F (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:68:19)
gyp verb `which` failed at E (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:80:29)
gyp verb `which` failed at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:89:16
gyp verb `which` failed at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_isexe@2.0.0@isexe\index.js:42:5gyp verb `which` failed at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_isexe@2.0.0@isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:171:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:13:12)
gyp verb `which` failed at F (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:68:19)
gyp verb `which` failed at E (F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:80:29)
gyp verb `which` failed at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_which@1.3.1@which\which.js:89:16
gyp verb `which` failed at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_isexe@2.0.0@isexe\index.js:42:5gyp verb `which` failed at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_isexe@2.0.0@isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:171:21) {
gyp verb `which` failed stack: 'Error: not found: python2\n' +
gyp verb `which` failed ' at getNotFoundError (F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_which@1.3.1@which\\which.js:13:12)\n' +
gyp verb `which` failed ' at F (F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_which@1.3.1@which\\which.js:68:19)\n' +
gyp verb `which` failed ' at E (F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_which@1.3.1@which\\which.js:80:29)\n' +
gyp verb `which` failed ' at F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_which@1.3.1@which\\which.js:89:16\n' +
gyp verb `which` failed ' at F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_isexe@2.0.0@isexe\\index.js:42:5\n' +
gyp verb `which` failed ' at F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_isexe@2.0.0@isexe\\windows.js:36:5\n' +
gyp verb `which` failed ' at FSReqCallback.oncomplete (fs.js:171: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 C:\Python37\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python37\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:303:12)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1026:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "F:\\06技术积累\\01技术代码\\01main\\GISShow\\client\\node_modules\\_node-gyp@3.8.0@node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-sass@4.14.1@node-sass
gyp ERR! node -v v13.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
× Install fail! Error: post install error, please remove node_modules before retry!
Run "C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js" error, exit code 1
at ChildProcess.<anonymous> (D:\Program Files\nodejs\node_global\node_modules\cnpm\node_modules\runscript\index.js:74:21)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1026:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npminstall version: 3.6.2
npminstall args: D:\Program Files\nodejs\node.exe D:\Program Files\nodejs\node_global\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\wsl\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://registry.npm.taobao.org
给我报这么一堆,我也是很懵啊,一开始以为可能是哪里装失败了,那我重装试试,还是不行,无论npm install
还是cnpm install
,没办法了,那肯定是必然错误了。
于是,我仔细阅读了长篇大论的错误信息,发现可能是node-sass导致的,主要看下面这段
Cached binary found at C:\Users\wsl\.npminstall_tarball\node-sass\4.14.1\win32-x64-79_binding.node
Binary found at F:\06技术积累\01技术代码\01main\GISShow\client\node_modules\_node-sass@4.14.1@node-sass\vendor\win32-x64-79\binding.node
Testing binary
Binary has a problem: Error: \\?\F:\06ææ¯ç§¯ç´¯\01ææ¯ä»£ç \01main\GISShow\client\node_modules\_node-sass@4.
14.1@node-sass\vendor\win32-x64-79\binding.node is not a valid Win32 application.
然后我找到了对应文件夹下面的binging.node,发现大小为0是个无效文件,于是我到node-sass的github上下载了对应版本的win32-x64-79_binding.node,替换node_modules\_node-sass@4. 14.1@node-sass\vendor\win32-x64-79\binding.node
,然后就“治好了”
同时,也替换了C:\Users\wsl\.npminstall_tarball\node-sass\4.14.1\win32-x64-79_binding.node
文件夹下的win32-x64-79_binding.node
,以绝后患!!!
以此为鉴,以后还是装32位的node吧
网友评论