我在newboston Youtube频道上关注React和Redux的教程,当我导航到提供文件的目录时,无法安装依赖项。这是链接,我正在完全按照视频开头的https://www.youtube.com/watch?v=TSAw5f8mOQs&list=PL6gx4Cwl9DGBbSLZjvleMwldX8jGgXV6a&index=3
提示这是我得到的错误:
:~$ npm install
npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/home/joe/package.json'
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 3.19.0-56-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/joe
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/joe/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/joe/npm-debug.log
npm ERR! not ok code 0
答案 0 :(得分:1)
你缺少package.json。
有两种可能性:
如果要创建新的package.json,请使用npm init
命令设置package.json。
如果您已经从某个仓库获得了一些代码,cd
到了您package.json
所在的目录并执行了npm install
或npm i