簡體   English   中英

node-gyp重建失敗bcrypt(Windows 8.1 x64)

[英]node-gyp rebuild fail bcrypt (Windows 8.1 x64)

我一直在嘗試在我的項目文件夾中安裝bcrypt模塊,但是我繼續收到此錯誤:

D:\Node.JS\todo_app>npm install bcrypt --save

> bcrypt@0.8.5 install D:\Node.JS\todo_app\node_modules\bcrypt
> node-gyp rebuild


D:\Node.JS\todo_app\node_modules\bcrypt>if not defined npm_config_node_gyp (node
 "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\no
de_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Traceback (most recent call last):
  File "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\npm\node_modules\node-gy
p\gyp\gyp_main.py", line 13, in <module>
    import gyp
  File "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\npm\node_modules\node-gy
p\gyp\pylib\gyp\__init__.py", line 8, in <module>
    import gyp.input
  File "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\npm\node_modules\node-gy
p\gyp\pylib\gyp\input.py", line 15, in <module>
    import multiprocessing
  File "C:\Python27\lib\multiprocessing\__init__.py", line 84, in <module>
    import _multiprocessing
ImportError: DLL load failed: %1 n’est pas une application Win32 valide.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Ghuen\AppData\Roaming\npm\
node_modules\npm\node_modules\node-gyp\lib\configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ghuen\\AppDat
a\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "r
ebuild"
gyp ERR! cwd D:\Node.JS\todo_app\node_modules\bcrypt
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN todo_app@1.0.0 No description
npm WARN todo_app@1.0.0 No repository field.
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ghuen\\AppData\\
Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt" "--save"
npm ERR! node v5.7.1
npm ERR! npm  v3.8.2
npm ERR! code ELIFECYCLE

npm ERR! bcrypt@0.8.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.5 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 bcrypt 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 bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Node.JS\todo_app\npm-debug.log

D:\Node.JS\todo_app>

另外,每當我運行node-gyp configure ,都會出現此錯誤:

D:\Node.JS\todo_app>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.3.1
gyp info using node@5.7.1 | win32 | x64
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\Ghuen\\AppData\\Roaming\\npm\\node_modules\\no
de-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Node.JS\\todo_app\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ghuen\\AppData\\Roaming\\npm\\node_modules\\no
de-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ghuen\\.node-gyp\\5.7.1\\include\\node\\common
.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Ghuen\\.node-gyp\\5.7.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Ghuen\\AppData\\Roaming\\npm\\n
ode_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\Node.JS\\todo_app',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\Node.JS\\todo_app\\build',
gyp info spawn args   '-Goutput_dir=.' ]
Traceback (most recent call last):
  File "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py
", line 13, in <module>
    import gyp
  File "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\_
_init__.py", line 8, in <module>
    import gyp.input
  File "C:\Users\Ghuen\AppData\Roaming\npm\node_modules\node-gyp\gyp\pylib\gyp\i
nput.py", line 15, in <module>
    import multiprocessing
  File "C:\Python27\lib\multiprocessing\__init__.py", line 84, in <module>
    import _multiprocessing
ImportError: DLL load failed: %1 n’est pas une application Win32 valide.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Ghuen\AppData\Roaming\npm\
node_modules\node-gyp\lib\configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ghuen\\AppDat
a\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd D:\Node.JS\todo_app
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

https://www.python.org/downloads/重新安裝Python,這應該可以解決brew install python引起的任何問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM