2022云计算公有云RocketChat,解决npm下载失败问题,不需要更换node版本!!!

仅供学习参考使用,有需要可私信博主交流

【题目 7】RocketChat 上云[0.5 分]

使用 http 服务器提供的压缩文件 rocketchat-cloud.tar.gz 中的 RocketChat 软件包,在 ChinaSkill-node- 1 中部署 RocketChat 的 Web 服务。使用 chinaskill-sql- 1 的 MongoDB 为后端 数据库,设置 RocketChat 服务访问端口为 3000 。完成 Rocketchat 系统上云后, 将
ChinaSkill-node- 1 节点的用户名、密码和公网 IP 地址到答题框。

安装npm

[root@chinaskill-sql-1 ~]# cd /root/rocketchat-cloud/bundle/programs/server
[root@chinaskill-sql-1 server]# ls
app            boot-utils.js.map  mini-files.js.map        npm-rebuild.js.map   package.json    runtime.js
assets         config.json        npm                      npm-rebuilds.json    packages        runtime.js.map
boot.js        debug.js           npm-rebuild-args.js      npm-require.js       profile.js      server-json.js
boot.js.map    debug.js.map       npm-rebuild-args.js.map  npm-require.js.map   profile.js.map  server-json.js.map
boot-utils.js  mini-files.js      npm-rebuild.js           npm-shrinkwrap.json  program.json
[root@chinaskill-sql-1 server]# npm install

报错。。。。。来了

[root@chinaskill-sql-1 server]# npm install
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

> fibers@4.0.3 install /root/rocketchat-cloud/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-72-glibc` exists; testing
Problem with the binary; manual build incoming
make: Entering directory `/root/rocketchat-cloud/bundle/programs/server/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
make: g++: Command not found
make: *** [Release/obj.target/fibers/src/fibers.o] Error 127
make: Leaving directory `/root/rocketchat-cloud/bundle/programs/server/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 3.10.0-1160.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /root/rocketchat-cloud/bundle/programs/server/node_modules/fibers
gyp ERR! node -v v12.22.12
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@4.0.3 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@4.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-05-06T13_02_15_422Z-debug.log

解决,安装gcc-c++模块

[root@chinaskill-sql-1 server]# yum install gcc-c++ -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.njupt.edu.cn
 * extras: mirrors.cqu.edu.cn
 * updates: mirrors.cqu.edu.cn
Package gcc-c++-4.8.5-44.el7.x86_64 already installed and latest version
Nothing to do
[root@chinaskill-sql-1 server]#
[root@chinaskill-sql-1 server]# npm install
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> fibers@4.0.3 install /root/rocketchat-cloud/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-72-glibc` exists; testing
Problem with the binary; manual build incoming
make: Entering directory `/root/rocketchat-cloud/bundle/programs/server/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
  CXX(target) Release/obj.target/fibers/src/coroutine.o
  CC(target) Release/obj.target/fibers/src/libcoro/coro.o
  SOLINK_MODULE(target) Release/obj.target/fibers.node
  COPY Release/fibers.node
make: Leaving directory `/root/rocketchat-cloud/bundle/programs/server/node_modules/fibers/build'
Installed in `/root/rocketchat-cloud/bundle/programs/server/node_modules/fibers/bin/linux-x64-72-glibc/fibers.node`
npm WARN lifecycle meteor-dev-bundle@~install: cannot run in wd meteor-dev-bundle@ node npm-rebuild.js (wd=/root/rocketchat-cloud/bundle/programs/server)
added 1 package from 1 contributor and audited 148 packages in 58.938s
found 2 vulnerabilities (1 moderate, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
[root@chinaskill-sql-1 server]# node -v
v12.22.12
[root@chinaskill-sql-1 server]#

注意修改IP信息

[root@chinaskill-sql-1 bundle]# ls
main.js  programs  README  server  star.json
[root@chinaskill-sql-1 bundle]# export ROOT_URL='http://localhost:3000'
[root@chinaskill-sql-1 bundle]# export PORT="3000"
[root@chinaskill-sql-1 bundle]# export MONGO_URL='mongodb://192.168.200.180:27017/rocketchat?replicsSet=rs'
[root@chinaskill-sql-1 bundle]# export MONGO_OPLOG_URL=mongodb://192.168.200.180:27017/local?replicaSet=rs
[root@chinaskill-sql-1 bundle]# node main.js
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
Setting default file store to GridFS
ufs: temp directory created at "/tmp/ufs"
Loaded the Apps Framework and loaded a total of 0 Apps!
Updating process.env.MAIL_URL
Using GridFS for custom sounds storage
Using GridFS for custom emoji storage
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
(node:3323) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
➔ System ➔ startup
➔ +----------------------------------------------+|                SERVER RUNNING                |+----------------------------------------------+|                                              ||  Rocket.Chat Version: 3.4.1                  ||       NodeJS Version: 12.22.12 - x64         ||      MongoDB Version: 4.0.28                 ||       MongoDB Engine: wiredTiger             ||             Platform: linux                  ||         Process Port: 3000                   ||             Site URL: http://localhost:3000  ||     ReplicaSet OpLog: Enabled                ||          Commit Hash: 21157c0c4f             ||        Commit Branch: HEAD                   ||                                              |+----------------------------------------------+

界面访问
2022云计算公有云RocketChat,解决npm下载失败问题,不需要更换node版本!!!_第1张图片

1.查看 RocketChat 服务正常计 0.2 分
2.查看前端页面是否正常返回计 0.3 分

你可能感兴趣的:(npm,云计算,json)