我已经安装了节点使用brew install node,当我使用时,node -v我得到了以下内容v5.0.0.但是,当我尝试运行npm命令时,我得到了npm: command not found.
我试图跑brew install npm,但我得到了以下回应node-5.0.0 already installed.
它发生在节点也返回命令未找到,但我通过运行修复brew link node,但是npm仍然似乎不起作用.
我该如何解决这个问题?
我正在尝试在Alpine 64bit Linux中运行二进制mongodb作为docker容器.但是在运行命令时:./mongodb发生以下错误:
bash-4.3 # ./mongod
bash: ./mongod: No such file or directory.
Run Code Online (Sandbox Code Playgroud)
出于什么原因它不能运行它?
我正在尝试运行npm install,为了安装我的项目的依赖项,这在我安装El Capitan(在Mac上)之前有效.
我尝试通过以下方法重新安装node和npm:
1.node js安装程序包
2.nvm
3.homebrew
npm -v 2.14.4
node -v v4.1.1
> bufferutil@1.1.0 install /Users/adamkraif/Documents/workspace/hunter-asteroid/node_modules/bufferutil
> node-gyp rebuild
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
../../nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^
../../nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
^
../../nan/nan.h:661:13: error: no member named 'smalloc' in namespace 'node'
, node::smalloc::FreeCallback callback
~~~~~~^
../../nan/nan.h:672:12: error: no matching function for call to 'New'
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^~~~~~~~~~~~~~~~~
/Users/adamkraif/.node-gyp/4.1.1/include/node/node_buffer.h:31:40: note: …Run Code Online (Sandbox Code Playgroud) 这是一个已知的问题很长一段时间,但我找不到任何明确的解决方案.
基本上,如果安装了一个模块npm install module,并且该模块创建了符号链接或安装了创建符号链接的其他模块,则安装将失败并显示错误.通常ETXTBSY或ENOENT.
这种情况发生在运行Ubuntu虚拟机的Windows主机上,安装模块的文件夹是属于主机的共享文件夹.
添加--no-bin-link参数有时会有所帮助,但它不适用于所有模块.全局选项也-g避免了这个问题,但是谁想要在全球范围内安装每个模块?
有人知道这个问题的正确解决方案吗?它真的很烦人,因为它使得在nodejs和Windows计算机上进行编程并且在Linux中进行测试是不可能的.
我使用makefile创建了我的dockers,并检查它是否正确.事实上,我能够运行它,甚至可以毫无问题地上传到Docker Hub.然后我按照建议的步骤将docker上传到Bluemix,但无法执行此操作.我收到一个错误,告诉我我的凭据不正确,虽然我确信它们不是(事实上,我能够使用相同的凭证登录Bluemix网站而没有问题).
请参阅下面我所做的步骤和获得的错误,欢迎任何解决这些问题的建议:
$ cf login
API endpoint: https://api.eu-gb.bluemix.net
Email> agorostidi
Password>
Autenticando...
OK
Org seleccionada agorostidi
Space seleccionado dev
Endpoint API: https://api.eu-gb.bluemix.net (version de API: 2.40.0)
Usuario: andres.gorostidi@gmail.com
Org: agorostidi
Space: dev
MacBook-Pro-de-Andres:apache-docker andres$ cf ic login
Client certificates are being retrieved from IBM Containers...
Client certificates are being stored in /Users/andres/.ice/certs/...
Client certificates are being stored in /Users/andres/.ice/certs/containers-api.eu-gb.bluemix.net/504cc61c-47e2-4528-914a-3def71277eea...
OK
Client certificates were retrieved.
Deleting old configuration file...
Checking local Docker configuration...
OK
Authenticating with registry at host name …Run Code Online (Sandbox Code Playgroud) node.js ×3
docker ×2
npm ×2
bash ×1
busybox ×1
containers ×1
credentials ×1
ibm-cloud ×1
mongodb ×1
virtualbox ×1