求助npm install bcrypt问题,有关于node.js npm安装-gyp rebuild

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
When trying to install some node.js packages (sqlite3 and socket.io in particular) using npm install socket.io on my Windows 7 machine with Visual Studio 2012 (and not 2010) I had some failures that looked like this:
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(35,5):
error MSB8020: The builds tools for Visual Studio 2010 (Platform
Toolset = 'v100') cannot be found. To build using the v100 build
tools, either click the Project menu or right-click the solution, and
then select "Update VC++ Projects...". Install Visual Studio 2010 to
build using the Visual Studio 2010 build tools.
19.1k56754
To get around this on my machine I did this command to install the package:
npm install socket.io --msvs_version=2012
I found the answer
when having the problem with installing sqlite3 and it worked with socket.io as well.
These might be more permanent solutions to fix the problem:
Install Visual Studio 2010
Updating the npm internal copy to a newer version of node-gyp as described
(probably the better option although I didn't get it working but didn't try for too long)
19.1k56754
Another option is to change config instead of specifying msvs_version every time:
npm config set msvs_version 2012
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
Post as a guest
required, but not shown
Post as a guest
required, but not shown
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled嗯~~,这个提问大家都在考虑......
[最新回答]
啊。一周又过去了
[最赞回答]
写代码都不习惯末尾加分号吗,有强迫症的我看的好难受
[最新回答]
我也遇到这个问题
相当恼火啊
[最新回答]
今天来为博客项目告一段落:试用Mongoose
Mongoose是MongoDB的一个对象模型工具,可以工作于异步环境下。 它的基本用法是定义一个模型,同时它对数据库的操作进行了很大的简化。...
[已采纳的回答]
第三篇分享热烘烘的出炉了。请移步:/wenda/detail/236130
[已采纳的回答]
WebApp开发就是这样。
[最赞回答]
我知道了,因为npm中install的git和所需要的不是同一个,大家需要去http://msysgit.github.io/下载Git-1.9.4-preview.exe安装包,安装后才可以。如果安装后仍然不行,需要重新设定Path环境变量,将安装后的bin目录加到Path中,然后在执行bowerinstallbootstrap就可以了。D:\Mooc&npm uninstall gitunbuild git@0.1.5D:\Mooc&bower install bootst...
[最赞回答]
会的 要做异常处理
[最赞回答]
先要添加git的系统环境变量
[已采纳的回答]
windows 下开发确实会有很多坑,我已经有 3 年多没有用过 windows 系统了,看这个报错感觉是 bcrypt 这个库安装的有问题,试试从 stackoverflow 上搜搜相关的 issue
[最新回答]
推荐使用webstorm
[已采纳的回答]
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
[最新回答]
我也出现了同样的问题,根据提示安装了python2.7.8,运行npm install bcrypt --save后等待了很久才执行完。
D:\WWW\node_modules\imooc_movie\movie&npm install bcrypt --sav...
[最赞回答]
前几天给人修改代码页发现这个问题,直接express imooc就OK了,app.js+view都是创建好的
[最赞回答]
添加git路径(我的是默认安装路径)$setPATH=%PATH%;D:\GitHub\Git\bin再次运行$bowerinstallbootstrap
[最赞回答]
加上这个就好了。楼下的提点。
[最赞回答]
这个课程面向有一定 nodejs 基础的童鞋,主要是通过快速走通一个网站的前后端,帮助童鞋了解从后台到网页展现的构建思路和手段,比如视图和数据的分离,数据和控制器的分离,串讲了 express 路由,mongoose 中间件,bower 等小知识,后面还有两期更加深度的课程,比如权限控制,单元测试,自动化的脚本和服务配置,欢迎关注,多提建议
[最新回答]
嗯,代码对没啥问题,不知道是不是框架版本的问题,我是刚安装的,多谢了哈!
[最新回答]
謝謝你們的回復 我決定再重新實作一次 有問題再把原始碼給大家看
首页上一页
我们的使命:传播互联网最前沿技术,帮助更多的人实现梦想!
Copyright (C)
All Rights Reserved | 京ICP备 号-2mac 上安装hexo出错,求帮助,谢谢。 - CNode
这家伙很懒,什么个性签名都没有留下。
发布于 2个月前
702 次浏览
mac osx 10.10
node v.10.33,node我是用brew安装的
输入sudo npm install -g hexo
第一个警告:
fsevents@0.2.0 install /usr/local/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents
node-gyp rebuild
gyp WARN EACCES user “root” does not have permission to access the dev dir “/Users/xiangwenwen/.node-gyp/0.10.33”
gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/local/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents/.node-gyp”
第二个错误信息:
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: node-v0.10.33.tar.gz local checksum cf30b93bb9baec62a1ae12d46ba7ca3096 not match remote 75dc26cdc91cb0d68aafe4b0c35f3a7a726b500edd081e
gyp ERR! stack
at deref (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:299:20)
gyp ERR! stack
at IncomingMessage.&anonymous& (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:340:13)
gyp ERR! stack
at IncomingMessage.emit (events.js:117:20)
gyp ERR! stack
at _stream_readable.js:943:16
gyp ERR! stack
at process._tickCallback (node.js:419:13)
gyp ERR! System Darwin 14.0.0
gyp ERR! command “node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /usr/local/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm WARN optional dep failed, continuing fsevents@0.2.0
尝试的解决办法:
一,sudo npm install -g node-gyp 安装node-gyp,然后再运行,警告与错误同上。
二,给/var/root改变权限,sudo chmod -R 777 /var/root 然后再运行,依然同上。
我无法解决这个问题,所以只发帖了,如果有人知道,还麻烦告诉一下,谢谢啦~
貌似以前遇到过,可以用 nvm 重装一下 node 试试?
不用brew来安装么?
亲,我现在用nvm 重装了node,问题依旧哎。
用安装包试试
1.npm cache clean --force
2.npm update
然后再安装。没遇过这问题,这是网上看到别人的说的。
我用安装包了,我把/var/root chmod 777 再安装的hexo,还是有警告,但是错误没了
我在Mac装pomelo也遇到跟你类似的警告,然后后面跟着一大堆错误。。。目前还没解决,晚上回去照你方法试试看,公司电脑只有window
能使用了吗?
嗯,目前可以使用了
权限啊,但是目前不清楚,哪个地方需要权限,所以我直接提升的root,完了又chmod 750了。
服务器搭建在
,存储赞助商为Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I'm trying to get working canvas on node js. I'm using Windows Vista. After basic approach npm install canvas failed (see error below), I have looked up some tutorials, here is what I have tried:
I have installed older Python (2.7.5) and add it to PATH (and remove Python 3.2. from PATH)
I have checked that I do have Microsoft Visual Studio 2010 Professional installed
I have downloaded the 'all in one' GTK package from , unziped it in C:\GTK\ and add 'C:\GTK\bin' to PATH
log in console (after running npm install canvas in cmd):
log contains several warnings, I don't thing these are the problem - it is mostly something like 'conversion from double to float', and one error marked in red color:
d:\pathToApp\node_modules\canvas\src\PNG.h(5): fatal error C1083: Cannot
open include file: 'cairo.h': No such file or directory [d:\pathToApp\n
ode_modules\canvas\build\canvas.vcxproj]
And at the very end of log there is:
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:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack
at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack
at Process.ChildProcess._handle.onexit (child_process.js:789:
gyp ERR! System Windows_NT 6.0.6002
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd d:\pathToApp\node_modules\canvas
gyp ERR! node -v v0.10.16
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
After that, nothing appeared in node-module folder (no canvas subdirectory, npm after unsuccessful installation removed the subdirectory).
So I have also tried to download canvas module manually from github, unzip it in node-modules and then run node-gyp configure in node-modules/canvas with success, and node-gyp build, which unfortunatelly gave me the same error Cannot open include file: 'cairo.h'.
I have read everything that I found on this carefully. If you can suggest any help, please do it.
I managed to get this working on windows after a long arduous process.
I have a last couple of suggestions that you might try that I had on my list.
Copy all the dll files from c:\GTK to the canvas\build\Release folder.
Copy IEShims.dll from c:\program files(x86)\Internet Explorer to the canvas\build\Release folder.
Then run node-gyp build.
Best of luck.
8,67321225
You will need cairo library which is bundled in GTK
I ran into trouble with canvas while trying to install .
Here's what worked for me.
My specifics
Windows 7 x64
node-v0.10.26-x64
Make sure you read the README. There are necessary instructions here that I overlooked the first time around. For instance:
Run: pkg-config --cflags gtk+-2.0
Run: gtk-demo and verify that it works
Running pkg-config let me know that I needed to have &GTK Directory&\lib\pkgconfig in the PKG_CONFIG_PATH environment variable.
I used this as a guide:
NOTE: I have Visual Studio
and 2013 installed on my machine, so I didn't have to deal with MSVC dependencies.
npm install canvas was always failing - and cleaning up after itself (the jerk) - so I grabbed the cached version from the npm-cache:
%USERPROFILE%\AppData\Roaming\npm-cache\canvas\1.1.3\package. Copy this directory to your project's node_modules directory and rename it canvas. Enter the newly created canvas directory on the command line.
Run npm install nan.
Before you you can run node-gyp configure successfully, you need to verify your GTK path in binding.gyp
On line 5:
'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle
Now you can try node-gyp configure. If this is successful, awesome!
Now you can build it: node-gyp build.
That should do it. If you were trying to install paper, now you can. Hooray!
If this doesn't work, or you have something to add, don't be shy! Please comment so we can all benefit.
I have managed to get it working on my new Windows 8 machine, so I want to share some details that can be helpful to others.
I am using:
Windows 8.1 (64 bit)
Visual Studio 2013 (update 2)
Python 2.7.8
GTK for Windows 64 bit ()
node 0.10.28
node-gyp 1.0.1
Be sure to have Python 2 and GTK\bin in your path.
I have downloaded files manualy from
and saved it to node_modules/canvas.
Then I run node-gyp configure build in canvas directory. Errors occured. I had to edit binding.gyp () in order to match actual files in GTK folder.
For example:
line 59: "(GTK_Root)/lib/libpng.lib" -> "(GTK_Root)/lib/libpng.dll.a"
line 34: "(GTK_Root)/bin/libpng14-14.dll" -> "(GTK_Root)/bin/libpng15-15.dll"
There can be more, you should be able to read which files are making problems from error log and then edit the names to match files in GTK folder.
After editing binding.gyp, command node-gyp configure build finished successfuly. Although I am not able to work with some jpg files in Canvas (I have not tested it properly), png files work fine.
If node-gyp fails
It can happen to you, that every node-gyp command fails with message (possibly marked in red) similar to:
"...bcrypt_lib.vcxproj(47,46): error MSB4025: Could not load file project. An invalid character for the specified encoding., Line 47, position 46."
It it most probably because you have special character in the name of your user folder. (The fact, that Windows 8 automatically creates the name of your user folder from your first name is the lamest thing about Win 8).
2 quick solutions:
create another user with normal (without special characters) name a and run node-gyp configure build from that account
use this quick fix (it has worked for me):
Hope this helps.
on how to install the components required to run node-gyp which is in turn required to compile the code for canvas (and jsdom). I'm going to replicate it here in case the link dies. I have tested these instructions on my Win7 x64 machine and it worked first time.
On Windows XP/Vista/7,
According to the readme file in , to ensure that your system has a supported configuration, uninstall the following products and then reinstall them in the order listed:
Note: If you get error on installation, maybe
will help you.
On x64 environments, the last update in the list fixes errors about missing compilers and error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found.
8,67321225
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
Post as a guest
required, but not shown
Post as a guest
required, but not shown
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 node.js npm 的文章

 

随机推荐