VagrantにてCentOS7を設定しました。
Vue.jsプロジェクト作成のために、node.jsやnpmのインストールを様々な方法(nやnvmでのnodeのバージョン管理、バージョン管理なしでnode v10.16.2のインストール)で試していますがvue create
コマンドを入力すると毎回同様のエラーが出てプロジェクトの作成ができません。
最終的には以下のQiitaの記事の手順でインストールを行いました。(vueプロジェクトの作成はinit
コマンドではなくcreate
コマンドです)
bash
1// rootユーザーでリポジトリの作成 2# curl -sL https://rpm.nodesource.com/setup_10.x | bash - 3// node.jsのインストール 4$ sudo yum install -y nodejs 5$ node -v 6v10.16.2 7$ npm -v 86.9.0
ゲストOSとホストOSとの共有フォルダworkspace
にtest
フォルダを作成し、vue create
コマンドを実行するとエラーが表示され、プロジェクトの作成に失敗します。
bash
1[test]$ vue create f3
以下がエラー内容です。作成されたf3
内はnode_modules
とpackage.json
があるのみです。
bash
1npm ERR! path /home/vagrant/workspace/test/f3/node_modules/@hapi/topo/node_modules/@hapi/hoek/package.json.2340471453 2npm ERR! code ENOENT 3npm ERR! errno -2 4npm ERR! syscall open 5npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/workspace/test/f3/node_modules/@hapi/topo/node_modules/@hapi/hoek/package.json.2340471453' 6npm ERR! enoent This is related to npm not being able to find a file. 7npm ERR! enoent 8 9npm ERR! A complete log of this run can be found in: 10npm ERR! /home/vagrant/.npm/_logs/2019-08-11T11_10_49_188Z-debug.log 11ERROR command failed: npm install --loglevel error
2019-08-11T11_10_49_188Z-debug.log
の内容で最後の方だけエラー内容と思われますので以下に記載しておきます
log
120511 warn @vue/cli-service@3.10.0 requires a peer of vue-template-compiler@^2.0.0 but none is installed. You must install peer dependencies yourself. 220512 verbose stack Error: ENOENT: no such file or directory, open '/home/vagrant/workspace/test/f3/node_modules/@hapi/topo/node_modules/@hapi/hoek/package.json.2340471453' 320513 verbose cwd /home/vagrant/workspace/test/f3 420514 verbose Linux 3.10.0-957.27.2.el7.x86_64 520515 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--loglevel" "error" 620516 verbose node v10.16.2 720517 verbose npm v6.9.0 820518 error path /home/vagrant/workspace/test/f3/node_modules/@hapi/topo/node_modules/@hapi/hoek/package.json.2340471453 920519 error code ENOENT 1020520 error errno -2 1120521 error syscall open 1220522 error enoent ENOENT: no such file or directory, open '/home/vagrant/workspace/test/f3/node_modules/@hapi/topo/node_modules/@hapi/hoek/package.json.2340471453' 1320523 error enoent This is related to npm not being able to find a file.
こちらの記事を参考にnpmの最新版へのアップデートはせずにvue.jsのインストールを行いましたが、エラー内容は変わりませんでした。
パッケージなど | バージョン |
---|---|
Vagrant | 2.2.4 |
ゲストOS | CentOS Linux release 7.6.1810 |
ホストOS | mac OS Mojave 10.14.5 |
node.js | 10.16.2 |
npm | 6.9.0 |
vue/cli | 3.9.3 |
今日1日このエラーと格闘していたのですが解決できず、、、どなたかお力をお借りできればと思い質問させていただきました。よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。