npm install 报错:node-pre-gyp ERR! 问题解决
npm install报错问题解决
问题:
E:\CodeSpace\GitlabTest\desktop>npm install
> lifeccp-desktop@1.1.9 postinstall E:\CodeSpace\GitlabTest\desktop
> install-app-deps
Installing app dependencies for arch x64 to E:\CodeSpace\GitlabTest\desktop\app
> sqlite3@3.1.4 install E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.4/electron-v1.2-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.4 and electron@1.2.7 (electron-v1.2 ABI) (falling back to source compile with node-gyp)
E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean )
E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 ) else (node "" configure --fallback-to-build --module=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 )
gyp WARN install got an error, rolling back install gyp ERR! configure error
gyp ERR! stack Error: read ECONNRESET gyp ERR! stack at exports._errnoException (util.js:1008:11)
gyp ERR! stack at TCP.onread (net.js:563:26)
gyp ERR! System Windows_NT 10.0.10586 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=E:\\CodeSpace\\GitlabTest\\desktop\\app\\node_modules\\sqlite3\\lib\\binding\\electron-v1.2-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=E:\\CodeSpace\\GitlabTest\\desktop\\app\\node_modules\\sqlite3\\lib\\binding\\electron-v1.2-win32-x64" gyp ERR! cwd E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3 gyp ERR! node -v v6.3.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:852:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) node-pre-gyp ERR! System Windows_NT 10.0.10586 node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\CodeSpace\\GitlabTest\\desktop\\app\\node_modules\\sqlite3\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3
node-pre-gyp ERR! node -v v6.3.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64' (1)
npm WARN lifeccp-desktop@1.1.9 No repository field.
npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! node v6.3.0
npm ERR! npm v3.10.5 npm ERR! code ELIFECYCLE
npm ERR! sqlite3@3.1.4 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 1 npm ERR!
npm ERR! Failed at the sqlite3@3.1.4 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-pre-gyp install --fallback-to-build npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request:
npm ERR! E:\CodeSpace\GitlabTest\desktop\app\npm-debug.log
Unhandled rejection Error: C:\Program Files\nodejs\node.exe exited with code 1
at ChildProcess.childProcess.on.code (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\util\util.ts:127:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) From previous event:
at spawn (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\util\util.ts:112:9)
at spawnNpmProduction (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\util\util.ts:46:9)
at Object.installDependencies (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\util\util.ts:24:120)
at E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\install-app-deps.ts:29:2
at next (native)
From previous event:
at tsAwaiter (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\util\awaiter.ts:10:47)
at main (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\install-app-deps.ts:22:3)
at Object.<anonymous> (E:\CodeSpace\GitlabTest\desktop\node_modules\electron-builder\src\install-app-deps.ts:34:7)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10) at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9) at bootstrap_node.js:467:3
npm WARN optional Skipping failed optional dependency /electron-builder/appdmg:
npm WARN notsup Not compatible with your operating system or architecture: appdmg@0.4.5
npm WARN optional Skipping failed optional dependency /7zip-bin/7zip-bin-osx:
npm WARN notsup Not compatible with your operating system or architecture: 7zip-bin-osx@0.1.0 npm WARN optional Skipping failed optional dependency /7zip-bin/7zip-bin-linux:
npm WARN notsup Not compatible with your operating system or architecture: 7zip-bin-linux@1.0.2
npm WARN lifeccp-desktop@1.1.9 No repository field. npm WARN lifeccp-desktop@1.1.9 No license field.
E:\CodeSpace\GitlabTest\desktop>npm install --python=python2.7
> lifeccp-desktop@1.1.9 postinstall E:\CodeSpace\GitlabTest\desktop
> install-app-deps
Installing app dependencies for arch x64 to E:\CodeSpace\GitlabTest\desktop\app
> sqlite3@3.1.4 install E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.4/electron-v1.2-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.4 and electron@1.2.7 (electron-v1.2 ABI) (falling back to source compile with node-gyp)
E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean )
E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 --python=python2.7 ) else (node "" configure --fallback-to-build --module=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=E:\CodeSpace\GitlabTest\desktop\app\node_modules\sqlite3\lib\binding\electron-v1.2-win32-x64 --python=python2.7 )
^终止批处理操作吗(Y/N)? Y
E:\CodeSpace\GitlabTest\desktop>npm install --python=python2.7
> lifeccp-desktop@1.1.9 postinstall E:\CodeSpace\GitlabTest\desktop
> install-app-deps
Installing app dependencies for arch x64 to E:\CodeSpace\GitlabTest\desktop\app
npm WARN lifeccp-desktop@1.1.9 No repository field.
npm WARN optional Skipping failed optional dependency /electron-builder/appdmg:
npm WARN notsup Not compatible with your operating system or architecture: appdmg@0.4.5
npm WARN optional Skipping failed optional dependency /7zip-bin/7zip-bin-linux:
npm WARN notsup Not compatible with your operating system or architecture: 7zip-bin-linux@1.0.2
npm WARN optional Skipping failed optional dependency /7zip-bin/7zip-bin-osx:
npm WARN notsup Not compatible with your operating system or architecture: 7zip-bin-osx@0.1.0
npm WARN lifeccp-desktop@1.1.9 No repository field.
npm WARN lifeccp-desktop@1.1.9 No license field.
E:\CodeSpace\GitlabTest\desktop>npm config set python python2.7
E:\CodeSpace\GitlabTest\desktop>npm install
> lifeccp-desktop@1.1.9 postinstall E:\CodeSpace\GitlabTest\desktop
> install-app-deps
Installing app dependencies for arch x64 to E:\CodeSpace\GitlabTest\desktop\app
npm WARN lifeccp-desktop@1.1.9 No repository field.
npm WARN optional Skipping failed optional dependency /electron-builder/appdmg:
npm WARN notsup Not compatible with your operating system or architecture: appdmg@0.4.5
npm WARN optional Skipping failed optional dependency /7zip-bin/7zip-bin-osx:
npm WARN notsup Not compatible with your operating system or architecture: 7zip-bin-osx@0.1.0
npm WARN optional Skipping failed optional dependency /7zip-bin/7zip-bin-linux:
npm WARN notsup Not compatible with your operating system or architecture: 7zip-bin-linux@1.0.2
npm WARN lifeccp-desktop@1.1.9 No repository field.
npm WARN lifeccp-desktop@1.1.9 No license field.
解决办法:
npm install --python=python2.7
npm config set python python2.7
---------------------------
问题:
npm ERR! Exit status 4294967295
E:\CodeSpace\GitlabTest\desktop>npm install -g node-sqlite3
> node-sqlite3@0.0.3 install C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-sqlite3
> node-gyp rebuild
C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-sqlite3>if not defined npm_config_node_gyp (node "C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果将该组件安装到了 其他位置,请将其位置添加到系统路径中。 [C:\Users\Adm
inistrator\AppData\Roaming\npm\node_modules\node-sqlite3\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Administrator\AppData\Roaming\npm\node_modules\node-sqlite3
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "node-sqlite3"
npm ERR! node v6.3.0
npm ERR! npm v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! node-sqlite3@0.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sqlite3@0.0.3 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sqlite3
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\CodeSpace\GitlabTest\desktop\npm-debug.log
npm install -g node-gyp
npm install -g node-sqlite3
需要强制指定:
npm config set msvs_version 2012 --global
-----------------------
使用cnpm:
npm install cnpm -g
npm install cnpm -g --registry=https://registry.npm.taobao.org
(关于electron的另一个问题:http://www.cnblogs.com/haochuang/p/5754120.html)
赠人玫瑰
手留余香
我们曾如此渴望命运的波澜,到最后才发现:人生最曼妙的风景,竟是内心的淡定与从容……我们曾如此期盼外界的认可,到最后才知道:世界是自己的,与他人毫无关系!-杨绛先生
如果,您希望更容易地发现我的新博客,不妨点击一下绿色通道的