質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Q&A

0回答

1014閲覧

nodejsのupdate

miiichat

総合スコア72

npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

0グッド

0クリップ

投稿2019/06/04 12:27

nodejsが古いみたいなのでnを使ってupdateしたいです。
boxはbento/centos-6.7ですが古いですか?

var fs = require('fs'); var http = require('http'); var settings = require('./settings'); var server = http.createServer(); server.on('request', function(req, res){ var stream = fs.createReadStream('index.html'); res.writeHead(200, {'Content-Type': 'text/html'}); stream.pipe(res); }); var io = require('socket.io').listen(server); io.sockets.on('connection', function(socket) { socket.emit('greeting', {message: 'hello'}, function (data) { console.log('result: ' + data); }); }); server.listen(settings.port, settings.host); console.log("server listening");
$ node server /home/vagrant/nodejs/node_modules/socket.io/lib/index.js:177 const keysIterator = this.parentNsps.keys(); ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/home/vagrant/nodejs/server.js:12:10) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)
[vagrant@localhost nodejs]$ node -v v0.10.48 [vagrant@localhost nodejs]$ npm -v 1.3.6 [vagrant@localhost nodejs]$ npm config set strict-ssl false [vagrant@localhost nodejs]$ sudo npm install -g n npm http GET https://registry.npmjs.org/n npm http GET https://registry.npmjs.org/n npm http GET https://registry.npmjs.org/n npm ERR! Error: CERT_UNTRUSTED npm ERR! at SecurePair.<anonymous> (tls.js:1430:32) npm ERR! at SecurePair.emit (events.js:92:17) npm ERR! at SecurePair.maybeInitFinished (tls.js:1029:10) npm ERR! at CleartextStream.read [as _read] (tls.js:521:13) npm ERR! at CleartextStream.Readable.read (_stream_readable.js:341:10) npm ERR! at EncryptedStream.write [as _write] (tls.js:418:25) npm ERR! at doWrite (_stream_writable.js:226:10) npm ERR! at writeOrBuffer (_stream_writable.js:216:5) npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11) npm ERR! at write (_stream_readable.js:602:24) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Linux 2.6.32-642.el6.x86_64 npm ERR! command "node" "/usr/bin/npm" "install" "-g" "n" npm ERR! cwd /home/vagrant/nodejs npm ERR! node -v v0.10.48 npm ERR! npm -v 1.3.6 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/vagrant/nodejs/npm-debug.log npm ERR! not ok code 0

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

gentaro

2019/06/04 23:01

質問内容が非常にわかりにくいのですが、「古いですか? 」と訪ねている対象は何ですか? n と node.js と npm と Vagrant box の4つの候補がありますが。 いずれにせよ、古いか否かはそれぞれの公式サイトに記載されている最新バージョンを確認すればいい話ですが、最後に貼られているnpmの実行結果のエラーはまた別の話のような気がします。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問