【发布时间】:2017-03-29 21:30:01
【问题描述】:
我正在关注 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
【问题讨论】:
-
您缺少文件 package.json
-
它在文件夹内(我拖到终端中以获取路径的文件夹),我是否需要将它放在其他地方?
-
您当前的工作目录是
/home/joe,但里面没有package.json。你能显示ls -l /home/joe/package.json、cat /home/joe/package.json和cat <backtick here>pwd<backtick here>\package.json的结果吗 -
你放 package.json 的文件夹是什么?
-
它说没有这样的文件或目录,对不起,我是新手。 json 与从 repo 下载的其他文件位于文件夹中,我应该更改工作目录并将其复制到那里吗?如果可能的话,您能否指导我如何做到这一点..?
标签: reactjs npm webpack redux npm-install