gpt4 book ai didi

mean-stack - 在 cloud9 上安装 MEAN 堆栈的最佳方法是什么?遵循手册时的错误消息

转载 作者:行者123 更新时间:2023-12-03 16:45:52 27 4
gpt4 key购买 nike

似乎有多种方法可以安装 Mean Stack (mean.io) 的所有模块。但是,在 c9.io 中执行此操作的最佳方法是什么?我一直在尝试很多事情,但我似乎并没有全部掌握。 c9.io 有专门的 NodeJs 工作区和安装 Angular.js 的方法,但我想要一切,快速、简单、快速!

注意:我尝试创建一个新工作区(Node.js),删除所有文件并运行以下链接中给出的命令:
http://learn.mean.io/#mean-installation

但是,我收到以下错误消息:

john@tut-04-mean:~/workspace $ cd app && npm install

> meanio@0.6.12 preinstall /home/ubuntu/workspace/app/node_modules/meanio
> node ./scripts/preinstall

npm WARN engine mean-cli@0.9.6: wanted: {"node":"0.10.x","npm":"2.1.x"} (current: {"node":"0.10.33","npm":"1.4.28"})

> mean-health@0.1.7 postinstall /home/ubuntu/workspace/app/node_modules/meanio/node_modules/mean-health
> node ./postinstall.js


> mean-cli@0.9.6 preinstall /home/ubuntu/workspace/app/node_modules/meanio/node_modules/mean-cli
> node ./scripts/preinstall

npm WARN optional dep failed, continuing fsevents@0.3.1
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})

> phantomjs@1.9.12 install /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
/ [==============--------------------------] 36% 0.0s\
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1416576264996/phantomjs-1.9.8-linux-x86_64 -> /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Removing /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1416576264996
Writing location.js file
Done. Phantomjs binary available at /home/ubuntu/workspace/app/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})

> kerberos@0.0.4 install /home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/kerberos.node
SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
COPY Release/kerberos.node
make: Leaving directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})
npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"0.10.33","npm":"1.4.28"})

> bson@0.2.15 install /home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/obj.target/bson.node
SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
COPY Release/bson.node
make: Leaving directory `/home/ubuntu/workspace/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'

> ws@0.4.32 install /home/ubuntu/workspace/app/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/home/ubuntu/workspace/app/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
COPY Release/validation.node
make: Leaving directory `/home/ubuntu/workspace/app/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build'
npm ERR! Error: EACCES, mkdir '/home/ubuntu/.npm/mongodb/1.3.23'
npm ERR! { [Error: EACCES, mkdir '/home/ubuntu/.npm/mongodb/1.3.23']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/ubuntu/.npm/mongodb/1.3.23',
npm ERR! parent: 'connect-mongo' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.14.13-c9
npm ERR! command "/home/ubuntu/.nvm/v0.10.33/bin/node" "/home/ubuntu/.nvm/v0.10.33/bin/npm" "install"
npm ERR! cwd /home/ubuntu/workspace/app
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /home/ubuntu/.npm/mongodb/1.3.23
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/ubuntu/.npm/mongodb/1.3.23'
npm ERR! not ok code 0

最佳答案

您可以按照 mean.io 在其网站上描述的方式在 Cloud9 中安装 mean.io。只需创建一个新的 NodeJS 项目,然后删除它提供给您的默认文件并在终端运行:

sudo npm install -g mean-cli 
mean init yourNewApp

(来自 mean.io 网站)

编辑:由于 root 拥有/home/ubuntu/.npm/mongodb 文件夹的所有权,因此发生 EACCES 错误。您可以通过运行来修复它们:
sudo chown $(whoami). ~/.npm/*

我注意到在我自己的安装中 npm install 在此修复后由于安装了一些软件包而无法完全工作。如果运行上述命令后仍然出现错误,请在项目文件夹中执行以下操作:
rm -rf ./node_modules
npm install

关于mean-stack - 在 cloud9 上安装 MEAN 堆栈的最佳方法是什么?遵循手册时的错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26977499/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com