我按照松露网站的指示开箱反应https://github.com/truffle-box/react-box
但是,当我输入“ npm run start”时,我得到了错误消息
npm ERR! path D:\COMP495\testReact\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\COMP495\testReact\package.json'
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! C:\Users\l_zha\AppData\Roaming\npm-cache\_logs\2018-11-21T12_45_14_733Z-debug.log
我可能注意到,无论出于何种原因,我的根目录中都没有'package.json'文件。我的客户文件夹中有一个“ package.json”文件,因此我可以运行React,尽管没有成功。
答案 0 :(得分:0)
弄清楚了。我需要从客户端目录运行它。从那里,在/ Client / src /中,我需要从/ build / contracts /添加合同文件夹,而不是从根目录添加/ contracts /,因为那里没有json文件。