npm ERR! enoent ENOENT: no such file or directory, open ... package.json


問題

npm install 遇到 no such file or directory,原因是沒有 package.json。

錯誤訊息:

vagrant@homestead:~/code/redis-test$ npm install

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/code/redis-test/node_modules/webpack-dev-server/node_modules/is-absolute-url/package.json.3672698083
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/code/redis-test/node_modules/webpack-dev-server/node_modules/is-absolute-url/package.json.3672698083'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2020-09-03T02_30_49_347Z-debug.log

解決

npm init -y 產生 package.json

隨筆






Related Posts

【Day01】用tkinter製作圖形視窗介面(GUI)

【Day01】用tkinter製作圖形視窗介面(GUI)

[Day06] Applicative

[Day06] Applicative

前後端構架基礎概念

前後端構架基礎概念



Comments